关于"a == 1 && a == 2 && a==3"成立

一、 尝试01
let a = { value: 0, valueOf: () => { return this.value++ } }
console.log(a==1&&a==2&&a==3)
false
二、尝试02
let b = { value: 0, valueOf: function(){ return this.value++ } }
console.log(b==1&&b==2&&b==3)
false
三、尝试03
let c = { value: 0, valueOf: function(){ return ++this.value } }

console.log(c==1&&c==2&&c==3)
true
四、尝试04
let d = { value: 0, valueOf: () => { return ++this.value } }

console.log(d==1&&d==2&&d==3)
false

综上:第四次尝试成功。


Hold The Faith . Forever !
We can find a way .
Someday .
A path to a new world
And maybe
Maybe its just the begnning after all

author - Foraging Pawn

你可能感兴趣的:(关于"a == 1 && a == 2 && a==3"成立)