Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 1.49 KB

File metadata and controls

16 lines (11 loc) · 1.49 KB

Closure easy #closure #javascript

by Pawan Kumar @jsartisan

Take the Challenge

What will be the output of following code:

for (var i = 0; i < 3; i++) {
  setTimeout(() => console.log(i), 1);
}

for (let i = 0; i < 3; i++) {
  setTimeout(() => console.log(i), 1);
}

Back Share your Solutions Check out Solutions