Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
255 B
3
Indexable
Never
num = 5;
let counter = (function test(num) {
    return function(x=1) {
        for (let i = 0; i < x; i++) { 
            ++num
        }
        return num;
       
    }
})(num);
console.log(counter());
console.log(counter(2));
console.log(counter(3));