Code:
var x=0;
for(let i=0; i<5; i++){
setTimeout(()=>{
x++;
console.log(x);
}, 1000);
}
Output:
1
2
3
4
5BlogMate
Your BloggerSpace assistant
Hi! I'm BlogMate, your BloggerSpace assistant. Ask me to find blogs, recommend topics, or explain how the platform works — I'll pull live data and share clickable links.
Powered by Gemini · may occasionally be wrong
Code:
var x=0;
for(let i=0; i<5; i++){
setTimeout(()=>{
x++;
console.log(x);
}, 1000);
}
Output:
1
2
3
4
5BloggerSpace author · 2 followers
Enjoying the read?
Get new posts delivered straight to your inbox. No spam, opt out anytime.