Justin Ohms
Oct 2, 2021

--

One of the worst examples of this is using a double not operator, “!!” to test for undefined values.

Not only is this a terribly unclear way to type-coerce a value to a boolean but it also, as such, catches all falsely values.

!!someVar

Is no way equivalent to the much clearer and accurate.

someVar !== undefined

--

--

No responses yet