falsy values javascript
// JS Essentials: Falsy Values
false
undefined
null
NaN
0 or +0 or -0
"" or '' or `` (empty string)
// Everything else is truthy
falsy values javascript
// JS Essentials: Falsy Values
false
undefined
null
NaN
0 or +0 or -0
"" or '' or `` (empty string)
// Everything else is truthy
falsy values javascript
false //The keyword false.
0 //The Number zero (so, also 0.0, etc., and 0x0).
-0 //The Number negative zero (so, also -0.0, etc., and -0x0).
0n, -0n //The BigInt zero and negative zero (so, also 0x0n/-0x0n).
"", '', `` //Empty string value.
null //the absence of any value.
undefined //the primitive value.
NaN //not a number.
document.all
//Objects are falsy if and only if they have the [[IsHTMLDDA]] internal slot.
//That slot only exists in document.all and cannot be set using JavaScript.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us