var a = 42;
var b = null;
var c = "foo ;
if (a && (b || c){
console.log( "yep" );
}
Page-351 Code will work and it is also mentioned as the expression results in "foo" and gets coerced to true. In the entire chapter, if the code will work, we have shown the output of console in comments // output. Ideally, here it should be there. It will be easier to relate things. :)
Per the contribution guidelines, I'm not accepting corrections on the first edition books (which have been published for more than 5 years now). Thank you.
Edition: 1st
Book Title: Types and Grammar
Chapter: Chapter 4
Section Title: Coercion
Question:
Page-351 Code will work and it is also mentioned as the expression results in "foo" and gets coerced to true. In the entire chapter, if the code will work, we have shown the output of console in comments // output. Ideally, here it should be there. It will be easier to relate things. :)