Created
March 14, 2019 16:36
-
-
Save anztrax/287d692b8a20de3f418b9f04daf82795 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
/** | |
* the value will be all 2 , but if you change into *let*. that will not be happend | |
**/ | |
let callbacks = []; | |
for(var i=0;i < 2; i++){ | |
callbacks.push(() => { | |
console.log(i); | |
}); | |
}; | |
callbacks.forEach((callback) => callback()); | |
const aFunction = () => { | |
console.log('a function'); | |
}; | |
aFunction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment