File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ The following people are totally rad and awesome because they have contributed r
23
23
* [ Anton Rissanen
] ( http://github.com/antris ) * [email protected] *
24
24
* Calum Robertson * http://github.com/randusr836 *
25
25
* Jake Burkhead * https://github.com/jlburkhead *
26
+ * [ Alex Johnson] ( https://github.com/nonsensery )
26
27
* ...You! What are you waiting for? Check out the [ contributing] ( /contributing ) section and get cracking!
27
28
28
29
# Developers
Original file line number Diff line number Diff line change @@ -56,6 +56,16 @@ array1
56
56
# => [ 1, 2, 3, 4, 5, 6]
57
57
{% endhighlight %}
58
58
59
+ A more idiomatic approach is to use the splat operator (` ... ` ) directly in an array literal. This can be used to concatenate any number of arrays.
60
+
61
+ {% highlight coffeescript %}
62
+ array1 = [ 1, 2, 3]
63
+ array2 = [ 4, 5, 6]
64
+ array3 = [ array1..., array2...]
65
+ array3
66
+ # => [ 1, 2, 3, 4, 5, 6]
67
+ {% endhighlight %}
68
+
59
69
## Discussion
60
70
61
71
CoffeeScript lacks a special syntax for joining arrays, but ` concat() ` and ` push() ` are standard JavaScript methods.
You can’t perform that action at this time.
0 commit comments