Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ref = new Reference();
- var arr = [1, 2, ref];
- ref.overwrite(3);
- console.log(arr); // output: [1,2,3]
- var arr = [1, 2, null];
- var ref = {object: arr, index: 2};
- ref.object[ref.index] = 3;
- console.log(arr); // output: [1, 2, 3]
Add Comment
Please, Sign In to add comment