Created
February 8, 2018 04:05
-
-
Save Mk-Etlinger/1ff14785f30460f9f3fde24149e7c7cd to your computer and use it in GitHub Desktop.
Object.assign syntax usage
This file contains hidden or 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
| const myWorkSchedule = { | |
| monday: '10-5', | |
| tuesday: '10-5', | |
| friday: '11-9' | |
| } | |
| const updatedSchedule = Object.assign({}, myWorkSchedule, { thursday: '8-5' }) | |
| updatedSchedule | |
| // {monday: "10-5", tuesday: "10-5", friday: "11-9", thursday: "8-5"} | |
| myWorkSchedule | |
| // {monday: "10-5", tuesday: "10-5", friday: "11-9"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment