3 ms·
Doesn't it also check for null not just undefined? Isn't that the whole point?
by CmonDev 11y ago
Doesn't it also check for null not just undefined? Isn't that the whole point?
- tracker1 11y agoAny 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.