4 ms·
Any truthy value will be returned and short out the boolean expression.. falsy values fall through... falsy values are: "", 0, null, undefined, NaN and false
by tracker1 11y ago
Any truthy value will be returned and short out the boolean expression.. falsy values fall through...
falsy values are: "", 0, null, undefined, NaN and false
Everything else is truthy.
I kind of wish that Invalid Date (invalidDt.valueOf() === NaN), empty arrays, and objects without any properties were also falsy sometimes. Though I also wish that sometimes 0 was easier to separate from other falsy values.