Skip to content

Instantly share code, notes, and snippets.

@pesblog
Last active August 29, 2015 14:02
Show Gist options
  • Save pesblog/7d23a56f404c4ea64b1e to your computer and use it in GitHub Desktop.
Save pesblog/7d23a56f404c4ea64b1e to your computer and use it in GitHub Desktop.
var k = [1, 2] // [1, 2]
var l = k // [1, 2]
var j = l // [1, 2]
l[1] = 3
k // [1, 3]
l // [1, 3]
j // [1, 3]
l.append(5)
k // [1, 3]
l // [1, 3, 5]
j // [1, 3]
let a = [1, 2] // [1, 2]
var b = a // [1, 2]
var c = b // [1, 2]
b[1] = 3
a // [1, 3]
b // [1, 3]
c // [1, 3]
b.append(5)
a // [1, 3]
b // [1, 3, 5]
c // [1, 3]
b = a
b = b + [5]
a // [1, 3]
b // [1, 3, 5]
c // [1, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment