Last active
July 15, 2017 00:52
-
-
Save btg5679/5362f30f3cba086333c5a703bdc415de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = { name: 'Pilsner', abv: 5.4 };// Remains untouched | |
var b = Object.assign({}, a, {abv: 6.7})// b = { name: 'Pilsner', abv: 6.7 }} | |
var a = [0, 1, 2]// Remains untouched | |
var b = a.concat(3)// b = [0, 1, 2, 3] | |
var c = a.filter((val) => != 2)// c = [0, 1, 3] | |
var a = {name: 'Dave Matthews', songs: [0, 1, 2]}// Remains untouched | |
var b = Object.assign({}, a, {name: 'Jack Johnson'});// b = {name: 'Jack Johnson', songs: [0, 1, 2]} | |
b.songs = a.songs.concat(3);// b = {name: 'Jack Johnson', things: [0, 1, 2, 3]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment