It seems that:
if (typeof a == \'undefined\') {
a = 0;
}
and
(typeof a != \'undefined\') || (a = 0)
h
(typeof a != 'undefined') || (a = 0)
is an expression. But one of its subexpressions
(a = 0)
is an assignment. So essentially, this is an expression with a side effect. Statements (especially those that are expessions), that have side effects are typically one of the first things you learn not to do in an introductory coding class. So why do it simply because it only takes one line?