Created
August 31, 2011 10:41
-
-
Save kpuputti/1183277 to your computer and use it in GitHub Desktop.
Javascript references
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment