Created
April 28, 2022 09:19
-
-
Save Elijah-trillionz/152d6820d57b6f05ad2f4e35e9bcf152 to your computer and use it in GitHub Desktop.
what will it log
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
// 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