JS, jeśli jest pusty, to 0

a = a || 0
Bored Booby