Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 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();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement