take runs a function with a given context and returns it, encapsulating
the usage of an object.
first3 = take ([1, 2]) -> @push 3
kindof returns the class of an object. It plays the role of typeof, only
it doesn't report 'object' for pretty much everything, and yields the actual
prototypes instead of strings.
kindof(undefined) is undefined
kindof(null) is null
kindof(1) is Number
kindof('foo') is String
kindof([]) is Array
kindof({}) is Object
kindof(new class X) is X
async takes a sync function that returns or throws and creates an async
version that takes a callback as last parameter. The callback is then
invoked with either (null, result) or (exception, null).
extend injects into its first argument all own properties of later
arguments, from left to right, so that later parameters take precedence.
merge works like extend, but starts with a new empty base object.
dict creates an object from an array of [key, value] pairs, paving the way
for python-like object comprehensions.
obj = dict([x, 'number: ' + x] for x in [1..10])
clone deep-clones an object of any type. null, undefined, numbers and
strings clone to themselves. Nested arrays and objects are properly
duplicated.
export makes idioms globally available. You can inject into another object,
instead of global, by passing it as parameter.
applyis a shortcut to Function.apply withthisas third, optional parameter (defaults tonull).