Skip to content

Instantly share code, notes, and snippets.

@balazs
Created June 17, 2015 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balazs/7de72ff970896fcfe883 to your computer and use it in GitHub Desktop.
Save balazs/7de72ff970896fcfe883 to your computer and use it in GitHub Desktop.
o = {}
Object {}
var struct = { content: [1,2,3] }
undefined
Object.defineProperty(o, 'ref', {value: struct, writable: false})
Object {ref: Object}
var s2 = o.ref
undefined
s2
Object {content: Array[3]}content: Array[3]__proto__: Object
s2.content[0]
1
s2.content[0] = 2
2
s2.content[0]
2
struct.content[0]
2
o.ref.content[0]
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment