Created
April 26, 2016 21:33
-
-
Save easierbycode/ceb0d374f1c28177d3131db719bf8beb to your computer and use it in GitHub Desktop.
destructuring and renaming from previously declared variables
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
| 'use strict'; | |
| let salary = { | |
| low: '32000', | |
| average: '50000', | |
| high: '90000' | |
| }; | |
| let newLow, newAverage, newHigh; | |
| ({ low: newLow, average: newAverage, high: newHigh } = salary); | |
| console.log( newHigh ); | |
| // '90000' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment