denysdovhan / wtfjs

🤪 A list of funny and tricky JavaScript examples
http://bit.ly/wtfjavascript
Do What The F*ck You Want To Public License
35.2k stars 2.55k forks source link

NaN instanceof Number // -> false #6

Closed Ginden closed 7 years ago

Ginden commented 7 years ago

Primitive types aren't instances of object wrappers.

42 instanceof Number; //false
Symbol() instanceof Symbol; // false
'foo bar' instanceof String; // false
false instanceof Boolean; // false
denysdovhan commented 7 years ago

@Ginden could you send a PR?

denysdovhan commented 7 years ago

Thanks for PR!