Hacker News new | ask | show | jobs
by eggsby 4512 days ago
Nice read, I had to think about a few of these.

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;
      }
    };
2 comments

Don't you mean:

   var A = function(){
     this.called = -1;
   }
   A.prototype.valueOf = function(){
     this.called += 1;
     Return this.called;
   }
   var a = new A()
I must think out of the box. I'm trying to find a number/string to make true. Nice catch.