let uniqueInteger = (function () { let counter = 0; return function () { return counter++ }; })(); console.log('uniqueInteger:',uniqueInteger()); console.log('uniqueInteger:',uniqueInteger());