Skip to content

Instantly share code, notes, and snippets.

@aurels
Last active August 29, 2015 14:23
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 aurels/dbf223128b41a20798f6 to your computer and use it in GitHub Desktop.
Save aurels/dbf223128b41a20798f6 to your computer and use it in GitHub Desktop.
var segments = Immutable.List()
undefined
segments
Object {size: 0, _origin: 0, _capacity: 0, _level: 5, _root: undefined…}
segments.push({id: 1, name: "Un"})
Object {size: 1, _origin: 0, _capacity: 1, _level: 5, _root: null…}
segments.push({id: 1, name: "Un"}).size
1
segments.push({id: 1, name: "Un"}).push({id: 2, name: "Deux"}).size
2
segments.push({id: 1, name: "Un"}).push({id: 2, name: "Deux"}).get(0)
Object {id: 1, name: "Un"}
segments.push({id: 1, name: "Un"}).push({id: 2, name: "Deux"}).get(1)
Object {id: 2, name: "Deux"}
segments.push({id: 1, name: "Un"}).push({id: 2, name: "Deux"}).splice(0, 1, {id:3, name: "Trois"})
Object {size: 2, _origin: 0, _capacity: 2, _level: 5, _root: null…}
segments.push({id: 1, name: "Un"}).push({id: 2, name: "Deux"}).splice(0, 1, {id:3, name: "Trois"}).get(1)
Object {id: 2, name: "Deux"}
segments.push({id: 1, name: "Un"}).push({id: 2, name: "Deux"}).splice(0, 1, {id:3, name: "Trois"}).get(0)
Object {id: 3, name: "Trois"}
segments.push({id: 1, name: "Un"}).push({id: 2, name: "Deux"}).splice(1, 1, {id:3, name: "Trois"}).get(0)
Object {id: 1, name: "Un"}
segments.push({id: 1, name: "Un"}).push({id: 2, name: "Deux"}).splice(1, 1, {id:3, name: "Trois"}).get(1)
Object {id: 3, name: "Trois"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment