Reputation: 10961
CoffeeScript comes with a few helper functions. How to use them? flatten(Array)
for example.
Upvotes: 6
Views: 1636
Reputation: 25592
These functions seem to be intended for private use by the CoffeeScript compiler. It might be better to use a general-purpose library like Underscore.js if you want these sort of features.
coffee> _ = require('underscore')
coffee> _.flatten [1, 2, 3, [4, 5]]
[ 1, 2, 3, 4, 5 ]
Upvotes: 9