Here's is an interesting one:
if (a == 0 && a == 1 && a == 2) {
console.log(a); // ?
}
JavaScript implicitly calls valueOf method to convert an object into primitive value whenever it needs to (see mdn).
So if you design your object this way...
const a = {
value: 0,
valueOf() {
return this.value++;
}
}
You got yourself a self-increment object : )