1: The result of foo && baz
is not 1 because true equals to 1 in numerical terms.
var foo = 1;
var baz = 2;
foo && baz; // returns 2, which is considered as true
2: In the expression console.log(foo + +bar);
, the two plus signs have a specific purpose. What is it?
var foo = 1;
var bar = '2';
console.log(foo + +bar);