Skip to content

Instantly share code, notes, and snippets.

@bryzettler
Last active June 1, 2017 04:11
Show Gist options
  • Save bryzettler/65255db0ad4d2d0c04f5ac993ab5168f to your computer and use it in GitHub Desktop.
Save bryzettler/65255db0ad4d2d0c04f5ac993ab5168f to your computer and use it in GitHub Desktop.
const records = [
{ title: "The Clash", artist: "The Clash", type: "LP", lengthSec: 2220, released: "1977"},
{ title: "Rocket to Russia", artist: "Ramones", type: "LP", lengthSec: 1906, released: "1977"},
...etc
];
const wayOne = Object.assign({}, records);
const wayTwo = { ...records };
/*
=> {
0: { artist: "The Clash", lengthSec: 2220, released: "1977", title: "The Clash", type: "LP"},
1: { artist: "Ramones", lengthSec: 1906, realease: "1977", title: "Rocket to Russia", type: "LP"},
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment