In particular (a == 0) && (a == 1) && (a == 2).
Here's a fun value for a:
var a = { called: -1, valueOf: function() { this.called += 1; return this.called; } };
var A = function(){ this.called = -1; } A.prototype.valueOf = function(){ this.called += 1; Return this.called; } var a = new A()
http://37signals.com/svn/posts/3543-google-uses-big-data-to-...
> And another one, completely useless in production code, but a nice puzzle to solve
Quite. I would prefer a job where I make production code not crossword puzzles.
PS: why do you even need to ask JS developers puzzles - all the most difficult problems are on server-side anyway (unless it is Node.js of course).
In particular (a == 0) && (a == 1) && (a == 2).
Here's a fun value for a: