I understand a||b returns an object, not boolean value. I just can't figure out why javascript gives different results for
undefined || "" (result is "")
"" || undefined (result is undefined)
which I think both should return "". Can someone explain it to me? Thanks!
Update: it is answered clearly by @Quentin, "" is evaluated as false, and a||b will return b if both a and b are evaluated as false.