I really don"t understand the operation principle of JS. I would like to ask my brother to explain a wave
.{}+[] ===0 true
[]+{} ===0 false
I really don"t understand the operation principle of JS. I would like to ask my brother to explain a wave
.{}+[] ===0 true
[]+{} ===0 false
{}
is a code block, so execute + []
. Because []
is an object, toPrimitive- > valueOf- > toString
is '
, resulting in +'= 0