Created
January 23, 2016 08:49
-
-
Save StevenJL/7131eeee5edd99607656 to your computer and use it in GitHub Desktop.
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
| var smallArray = [2,3,4] | |
| var bigArray = [1, ...smallArray, 5, 6, 7] // [1, 2, 3, 4, 5, 6, 7] | |
| // You can use it in function arguments | |
| var foo = function(a,b,c){ return a+b+c; } | |
| var args = [1,2,3] | |
| foo(...args) | |
| // like Ruby's splat, no? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment