coffeescript-cookbook/coffeescript-cookbook.github.com — pull request #123 by nonsensery (2014-11-25 22:57:32+00:00)
Title: Con-splat-enate Arrays

#### What's this PR do?

Adds a section to the "Concatenating Arrays" chapter that uses the splat operator (`...`) in an array literal (`[]`) to concatenate arrays.

For example:
```coffeescript
array1 = [1, 2, 3]
array2 = [4, 5, 6]
array3 = [array1..., array2...]
```

The **Discussion** section currently says that "CoffeeScript lacks a special syntax for joining arrays". I think you could argue that there _is_ a special syntax for joining arrays, and this is it.

This pattern also has some nice features like:

- It's highly readable.
- It scales easily and clearly to multiple arrays. `[array1..., array2..., array3...]`
- It allows other non-array elements to be interspersed. `[array1..., value1, value2, array2...]`