News for hackers. Stuff that matters.

gokangaroo

Re:Writing Eloquent JavaScript Without CoffeeScript on Friday December 09, 2011 @11:18AM (#3334237)
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.)