I'm a newbie in Javascript, and I'm trying to understand logical operators. I'm reading this document: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators
For example:
var a1 = true && true; // t && t returns true
var a2 = true && false; // t && f returns false
var a3 = false && true; // f && t returns false
I get this part because the variables are boolean values. I believe it is the same thing as:
var a1 = 1 && 1; // t && t returns 1
var a2 = 1 && 0; // t && f returns 0
var a3 = 0 && 0; // f && t returns 0
But when strings appear, I become confused:
var a6 = false && 'Cat'; // f && t returns false
var a7 = 'Cat' && false; // t && f returns false
var a5 = 'Cat' && 'Dog'; // t && t returns Dog
How can I compare boolean values with strings? What is the boolean value of each string?