for(var i=0; i<10; i++) { }
console.log(i);
Output: 10
Why am I able to use the variable initialized in for loop outside the loop in JS? This doesn't work in, say, Java.
for(var i=0; i<10; i++) { }
console.log(i);
Output: 10
Why am I able to use the variable initialized in for loop outside the loop in JS? This doesn't work in, say, Java.
برچسب:
نویسنده: استخدام کار