Last active
October 7, 2016 08:05
-
-
Save savelee/e7922bb28eb7ee22466c5a0acdf2c2ea to your computer and use it in GitHub Desktop.
Rest parameters & Spread Operator (2) - https://www.leeboonstra.com/developer/sencha-ecmascript-2015/
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 more = ["sencha", "extjs"]; | |
var tech = ["javascript", "html5", ...more, "css3"]; | |
console.log(tech); | |
//Array [ "javascript", "html5", "sencha", "extjs", "css3" ] |
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
//ES5 combining arrays | |
var more = ["sencha", "extjs"]; | |
var tech = ["javascript", "html5", "css3"]; | |
Array.prototype.push.apply(tech, more); | |
console.log(tech); | |
//Array [ "javascript", "html5", "sencha", "extjs", "css3" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment