DEV Community

Discussion on: You don't need null

 
loucyx profile image
Lou Cyx

We might not be understanding each other, if the API needs null to work, then use it when interacting with it. The article doesn't say "you should never ever use null", the point of the article is that we shouldn't default to it and use undefined instead. Instead of having null and undefined all over the code, you should use just undefined in your code, and if the API is limited to using null, then just use null in the functions or methods that interact with it.

I have a disclaimer at the bottom of every article in this series because folks generally understand "you don't need" as "you should never use", and that's not the point. This series is about re-evaluating our defaults.

Some comments have been hidden by the post's author - find out more