-
-
Save ilearnjavascript/26a3fdcdf986ef48b90bcbf728ba6014 to your computer and use it in GitHub Desktop.
es6 - destructuring - 7.js
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 es6_destructuring6 = function() { | |
var firstname = 'John'; | |
var lastname = 'Doe'; | |
[firstname, lastname] = [lastname, firstname]; | |
console.log(firstname); | |
console.log(lastname); | |
} | |
es6_destructuring6(); | |
// outputs: | |
// Doe | |
// John |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment