Created
October 10, 2017 17:55
-
-
Save silesky/2cb7156a51e6f20df10b91997321d410 to your computer and use it in GitHub Desktop.
blog_settimeout2
This file contains 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
let x; | |
const reassignX = () => x = 5; | |
setTimeout(reassignX, 1000); // no waiting, this gets 'skipped' | |
console.log(x) // undefined! -- gets run before ^ is done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment