Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var day = {name: 'day 1', rooms: [1, 2, 3]};
- // create a separate var pointing to the same room list
- var rooms = day.rooms;
- day.rooms === rooms; // true
- // delete the rooms list from the day object
- delete day.rooms;
- // room list should still point to the list
- rooms; // [1, 2, 3, 4]
Add Comment
Please, Sign In to add comment