Skip to content

Commit 50812ee

Browse files
committed
Ep-11 SetTimeOut with Closures
1 parent 74cb799 commit 50812ee

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function x () {
2+
for (let i = 1; i <= 5; i++)
3+
{
4+
console.log(i);
5+
function close (x) {
6+
setTimeout(() => {
7+
console.log(x);
8+
},x * 1000);
9+
}
10+
close(i)
11+
}
12+
13+
console.log("Namaste JavaScript");
14+
}
15+
x()

0 commit comments

Comments
 (0)