3 ms·
Never make clever use of undefined in JavaScript, as it will always result in a bug when someone decided to be a good citizen and gives the variable a value at
by z3t4 10y ago
Never make clever use of undefined in JavaScript, as it will always result in a bug when someone decided to be a good citizen and gives the variable a value at the same time it's declared.
Always be explicit, like var foo=-1; if(foo!=-1) instead of only var foo; if(foo).
It will also help the optimizer