Created
February 20, 2020 08:46
-
-
Save monirshimul/af801ea51bb84a7ec6fc4763832f54ed to your computer and use it in GitHub Desktop.
Revisions
-
monirshimul created this gist
Feb 20, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ function a(){ for (var i = 0; i<=10; i++){ var a = setTimeout(()=>{ var a = 10 },1000) var a = setTimeout(()=>{ var a = 11 },2000) var a = setTimeout(()=>{ var a = 12 },3000) console.log("This is from A :",a) } b() } function b(){ for (var i = 0; i<=10; i++){ var a = setTimeout(()=>{ return 10 },1000) var a = setTimeout(()=>{ return 11 },2000) var a = setTimeout(()=>{ return 12 },3000) console.log("This is from B :",a) } } a()