Created
July 25, 2016 14:50
-
-
Save savelee/3a8e85d69ae997cd1788759b35a25fec to your computer and use it in GitHub Desktop.
Example of array destructering
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 myarray = ["Ext JS", "GXT", "Sencha Test"]; | |
var [myvar1, myvar2, myvar3] = myarray; | |
console.log(myvar1) //Ext JS | |
console.log(myvar2) //GXT | |
console.log(myvar3) //Sencha Test |
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 myarray = ["Ext JS", "GXT", "Sencha Test"]; | |
var myvar1 = myarray[0]; | |
var myvar2 = myarray[1]; | |
var myvar3 = myarray[2]; | |
console.log(myvar1) //Ext JS | |
console.log(myvar2) //GXT | |
console.log(myvar3) //Sencha Test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment