Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var list = [1, 2, 3],
- newList = list;
- list.reverse();
- console.log(newList); // [3, 2, 1]
- // ~ OR ~
- var list = [1, 2, 3],
- newList = list;
- setTimeout(function () { list.reverse(); }, 0);
- console.log(newList); // [1, 2, 3]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement