I've seen this type of example and I understand how to get around it to do a proper comparison against foo and bar (where they are 2 different numbers) but I don't understand why the value of bar is returned in this case instead of a true/false value. Would be good to understand the reason the last value is returned as this is an equality check and not an assignment.
let a = foobar === foo || bar