Better HN
topnewbestaskshowjobs
Log inSign up

gokangaroo

2 karma · joined May 28, 2011 (15y ago) · 1 submissions

Submissions

comment 14y ago · link · parent

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