Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var functions = [];
- for(var i = 0; i < 10; i++) {
- functions.push(function() {
- console.log(i);
- });
- }
- for(var j = 0; j < 10; j++) {
- functions[j]();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement