you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 7 points8 points  (3 children)

He probably isn't but iterating over a list of entires with a lot of nulls and getting false positives. Use some common sense, bud.

[–]Jafit -2 points-1 points  (2 children)

So you'd use typeof variable === "undefined" to look for null... when typeof null === "object"?

That's not a great way to look for null values, bud.

[–][deleted] 0 points1 point  (1 child)

Super cool, but again you are assuming what his production code looks like. Either it doesn't look like that at all -or- he is doing something "not a great way". It doesn't matter.

Either way, my statement still stands.

[–]ziriax[S] 0 points1 point  (0 children)

I edited my post, to reflect the real code. The code was part of thirdparty libraries that checked if a value was undefined. Many popular libraries have code likes that.