Sure this is simple as but I can't find any documentation atm. I've been digging into ES6 and found the use of logic in expressions. As an example:
let arr = [1,2,3,4]
let result1 = (arr[2] || 0) //returns 3
let result2 = (arr[5] || 0) //returns 0
I understand whats going on (and like the idea!) but don't get why the result is an integer and not a boolean as I'd expect when using logic?