Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
gokangaroo
· 14y ago · 0 comments
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.)
Comments
[–]
DougBTX
14y ago
That's also a syntax error; I think CoffeeScript wins this round.