Advertisement
thebullno1

Untitled

Nov 21st, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var functions = [];
  2. for(var i = 0; i < 10; i++) {
  3.     functions.push(function() {
  4.         console.log(i);
  5.     });
  6. }
  7. for(var j = 0; j < 10; j++) {
  8.     functions[j]();
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement