Are you first timer at Why not join us and start exchange your programming knowledge with everyone. Register today!

JS Loop - inline variable declaration

0 votes
added Jul 7 in Javascript by LC Marshal First Warrant Officer (11,130 points)
edited 5 days ago by LC Marshal
for (let i = 0; i < 3; i++) {
  alert(i); // 0, 1, 2
alert(i); // error, no such variable

Please log in or register to response this reference. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.