3 ms·
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
by tonyarkles 13y 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
- mfonda 13y agoThat only works for consecutive integers, not any arbitrary values.