Last active
December 27, 2017 21:46
-
-
Save maciejsikora/f2713407ebfeb91f04396dbe84824306 to your computer and use it in GitHub Desktop.
Change by using spread operator
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
// object | |
const claraFrog = { color: 'green', name: 'Clara' }; | |
const juliaFrog = { ...claraFrog, name: 'Julia' }; | |
// array | |
const week = ['monday','tuesday','wednesday','thursday','friday','saturday', 'sunday']; | |
const betterWeek = [...week]; | |
betterWeek.shift(); // week without monday :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment