Cleanups
arneg opened this issue · comments
Arne Gödeke commented
==
vs ===
In most cases (e.g. the asm.js code being an exception) we always want ===. The main problem with == is not performance, but that things work 'accidentally' and real bugs are not discovered.
checking for undefined
In my opinion, the best way to do that is x === void 0
.
checking for arrays
using Array.isArray(x)
is better than typeof x === 'object' && x instanceof Array
.
Arne Gödeke commented
always use foo.bar
instead of foo["bar"]
if possible
its shorter, easier to type. Obvious exceptions of course are reserved keywords.