Hacker News new | ask | show | jobs
by tonyarkles 4442 days ago
Here's a JavaScript example, based on what was in the article.

    var b = {c:0};
    b.valueOf = function() { this.c++; return this.c; }
    b == 1 && b == 2
    > true
1 comments

That only works for consecutive integers, not any arbitrary values.