News for hackers. Stuff that matters.
Re:Intent to stop using 'null' in my JS code by anuila on Saturday October 31, 2020 @11:52PM (#24957095)
If the value is expected to be a Boolean, use undefined to set it as undefined.

For everything else, use false to “explicitly assign it”, you don’t need a third type.

Re:Intent to stop using 'null' in my JS code by JimDabell on Sunday November 01, 2020 @12:51AM (#24957312)
> use false to “explicitly assign it”

Then you still have null, you’re just spelling it funny while confusing all the other developers who have to deal with your code and making it incompatible with language constructs like the nullish coalescing operator.

If the concept you are trying to express is “null”, then please use null to represent that instead of bringing in a poor substitute like an overloaded false.

Re:Intent to stop using 'null' in my JS code by anuila on Sunday November 01, 2020 @04:38AM (#24958338)
No, most likely I'll just use undefined because my abstractions are not a complicated mess that need 2 null types.

Found? string

Not found? undefined

Re:Intent to stop using 'null' in my JS code by JimDabell on Sunday November 01, 2020 @07:54AM (#24959132)
> most likely I'll just use undefined

You were telling people to use false and that’s what I was responding to. That’s why I quoted that part in my comment.