Created
November 11, 2017 13:03
-
-
Save aderaaij/1dfd402bfcdf16f22cbabdc11cf207ae to your computer and use it in GitHub Desktop.
Switch out variables by destructuring in es6
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
// Switch out variables by destructuring in es6 | |
let first = 'first'; | |
let second = 'second'; | |
console.log(first, second); | |
[first, second] = [second, first]; | |
console.log(first, second); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment