Skip to content

Instantly share code, notes, and snippets.

@davismj
Created January 25, 2017 08:58
Show Gist options
  • Save davismj/c26c1567127dac71c859dfeadc966606 to your computer and use it in GitHub Desktop.
Save davismj/c26c1567127dac71c859dfeadc966606 to your computer and use it in GitHub Desktop.
Spread example.
a = [1,2,3] // [1, 2, 3]
b = [4,5] // [4, 5]
c = a.slice() // [1, 2, 3]
c.push(b) // 4
JSON.stringify(c) // "[1,2,3,[4,5]]"
JSON.stringify([...a, ...b]) // "[1,2,3,4,5]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment