Untitled
Anonymous
Plain Text
04/27/2023 10:11 AM
255 B
41
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));Editor is loading...