3 ms·
Reminds me of my favourite Javascript trivia question: What two values for a & b meet the following? > a === b true > Number(a) === a true > Number(b) ===
by paragraft 13y ago
Reminds me of my favourite Javascript trivia question:
What two values for a & b meet the following?
> a === b
true
> Number(a) === a
true
> Number(b) === b
true
> a + b === a
true
> (1 / a) === (1 / b)
false
- kevincennis 13y agoEdit: SPOILER ALERT 0 and -0. I never knew about this until I read a shim someone wrote for Object.is().