Skip to content

Instantly share code, notes, and snippets.

@silesky
Created October 10, 2017 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save silesky/2cb7156a51e6f20df10b91997321d410 to your computer and use it in GitHub Desktop.
Save silesky/2cb7156a51e6f20df10b91997321d410 to your computer and use it in GitHub Desktop.
blog_settimeout2
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