Skip to content

Instantly share code, notes, and snippets.

@Elijah-trillionz
Created April 28, 2022 09:19
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 Elijah-trillionz/152d6820d57b6f05ad2f4e35e9bcf152 to your computer and use it in GitHub Desktop.
Save Elijah-trillionz/152d6820d57b6f05ad2f4e35e9bcf152 to your computer and use it in GitHub Desktop.
what will it log
// what will it log
function foo(x) {
return function() {
x++;
console.log(x)
}
};
const x = 0;
const bar = foo(x);
const bip = foo(x);
bar();
bar();
bip();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment