If I execute the following snippet in FireBug console it somehow prints surprise!
:
['surprise!', 'boring'][Number(0=="")]
But why?
UPD
I am sorry, people, that was a joke! Jere is the first who noticed! Yesterday I found a ZERO WIDTH SPACE in a string, and had since then temptation to have some fun =)
There is an extra, non visible, character between your quotes.
If you type this out, you will get 'boring' because 0=="" evaluates to true, Number(true) evalutes to 1.
Paste these two and watch the differing output:
0==""
outputs false
0==""
outputs true
The only thing I have changed is deleting the character between ""
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With