/es6 - destructuring - 7.js Secret
Created
March 27, 2019 23:32
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