Skip to content

Instantly share code, notes, and snippets.

@kpuputti
Created August 31, 2011 10:41
Show Gist options
  • Save kpuputti/1183277 to your computer and use it in GitHub Desktop.
Save kpuputti/1183277 to your computer and use it in GitHub Desktop.
Javascript references
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