See this and many other articles at lucaspaganini.com
Falsy values are values that are considered
false when encountered in a boolean context. That means values that become
false if you try to convert them to a
Boolean(''); //=> false Boolean(0); //=> false Boolean(null); //=> false
0nrepresentations of zero 3. ```
''` empty string
NaNnot a number
document.allcan also be falsy in a very specific edge case.
Truthy values are the opposite. They are values that are considered
true when encountered in a boolean context.
ts Boolean('abc'); //=> true Boolean(1); //=> true Boolean(); //=> true
All values that are not falsy, are truthy.
References are in the references.
We release web development tutorials every two weeks. Consider subscribing if you're interested in that.
Have a great day, and I'll see you soon!