powerboy
powerboy

Reputation: 10961

How to use CoffeeScript's built-in helper functions?

CoffeeScript comes with a few helper functions. How to use them? flatten(Array) for example.

Upvotes: 6

Views: 1636

Answers (1)

Jon Gauthier
Jon Gauthier

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

Related Questions