var n = 'foo' / 2
typeof n == ...
var n = ''
n % 2 = ...
var n = null
typeof n == ...
var a = []
typeof a == ...
// check for integer
( typeof n == 'number' && n % 1 == 0 )
// is it a simple (anonymous) object?
!!(value && toString.call(value) == "[object Object]" && value.__proto__ == Object.prototype)
undefined or null and ===
CoffeeScript invents some good ideas and steals many others. The number one source I could identify for the most useful ideas in CoffeeScript? Perl.
Yes, Perl. The language that's guaranteed to produce an audible gasp if mentioned in civilized programming circles today.
Yet for ten solid years, Perl was a petri dish of syntactic innovation.
-- Geoffrey Grosenbach (coffeescript-in-motion)Declarative interface:
Non-native types:
Runtime typechecks in constructor
Lazy initialization, method generation, triggers:
Legend also has it that female jackalopes can be milked as they sleep belly up and that the milk can be used for a variety of medicinal purposes