It seems that:
if (typeof a == \'undefined\') {
a = 0;
}
and
(typeof a != \'undefined\') || (a = 0)
h
I think that it is terrible to use constructions like this. It works but code not readable. If you want to write one-line conditions you can start using CoffeeScript and write:
a = 0 if (typeof a == 'undefined');
In your case, when you have one variable in condition and assignment, use one-line javascript ternary operator:
a = (typeof a == 'undefined') ? 0 : a;