Do these two statements work the same?
var x = y ? y : 0;
var x = y || 0;
I have been using the first for a while, but if the second is the same, i would rather use that, as it is much shorter in a lot of cases (when y is a long variable name or statement, for example)