DeutscheSoft / toolkit

toolkit is a JavaScript user interface widget library for professional audio applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cleanups

arneg opened this issue · comments

== 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.

always use foo.bar instead of foo["bar"] if possible

its shorter, easier to type. Obvious exceptions of course are reserved keywords.