Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var list    = [1, 2, 3],
  2.     newList = list;
  3. list.reverse();
  4. console.log(newList); // [3, 2, 1]
  5.  
  6. // ~ OR ~
  7.  
  8. var list    = [1, 2, 3],
  9.     newList = list;
  10. setTimeout(function () { list.reverse(); }, 0);
  11. console.log(newList); // [1, 2, 3]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement