News for hackers. Stuff that matters.
Re:Intent to stop using 'null' in my JS code by reificator on Sunday November 01, 2020 @02:53AM (#24957882)
Undefined should mean in most cases that you've made a programming mistake, be that a typo or an invalid assumption about the type of thing you're getting back.

Null should mean in most cases that the data you wanted to access was invalid, but you can expect it to exist there in other circumstances.

Neither are a guarantee in JS, and you can find counterexamples for the counterexamples of the counterexamples, but that's the intention behind each.

There are no comments on this comment yet.