We might not be understanding each other, if the API needsnull 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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
We might not be understanding each other, if the API needs
nullto work, then use it when interacting with it. The article doesn't say "you should never ever usenull", the point of the article is that we shouldn't default to it and useundefinedinstead. Instead of havingnullandundefinedall over the code, you should use justundefinedin your code, and if the API is limited to usingnull, then just usenullin 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.