4 ms·
null and undefined are very different. Not sure how you leave null out of your code. You never interact with database? You're not supposed to pass undefined as
by mekster 6y ago
null and undefined are very different. Not sure how you leave null out of your code.
You never interact with database? You're not supposed to pass undefined as NULL value.
And a variable that is waiting to be defined is very different from a value that received null as a result.
Dealing all those mixed up as falsy is a bad design.
- orange8 6y agoI've already mentioned this above, please look up falsy and truthy values in JS. Null, false, 0, undefined and "" can be treated pretty much the same in 99% of your JS code. JS is after-all still a dynamic language, and there is nothing stopping you from making use of its dynamic features.