Note that || and // have different effects when the variable being tested is false! // only tests for undefined. || tests for any false value. ||= will replace 0 or '' with the right hand side value where //= will only replace undef with the right hand side value.