3 ms·
In these cases, I would check for the type, so instead of your example, I would say "var a = typeof a !== 'undefined' ? a || someDefault". (Not that that is par
by gokangaroo 15y ago
In these cases, I would check for the type, so instead of your example, I would say "var a = typeof a !== 'undefined' ? a || someDefault". (Not that that is particularly pretty, it's actually quite ugly.)
- DougBTX 15y agoThat's also a syntax error; I think CoffeeScript wins this round.