JavaScript is non-strictly typed language as Java,for example.
As we know, it converts value of result dependently upon context:
"2" + "3" results "23"
"2" * "3" results 6
This is quite clear and OK for understanding.
I just tried following expressions and got confused:
true && 1 results 1
true || 1 results true
Why the first gives Number and the second gives boolean?
Considering JavaScript conversion rules,I expect to get boolean values in both cases,due to boolean context of expression.
Check Douglas Crockford’s site, it says: