Created
February 20, 2020 08:46
-
-
Save monirshimul/af801ea51bb84a7ec6fc4763832f54ed to your computer and use it in GitHub Desktop.
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 characters
| 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() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment