var i=0; var b = {}; b.valueOf = function () { return ++i; }; if (b==1 && b==2) { console.log("success")}