5.1.1. Boolean Values¶ code example
Example 1: 5.1.1. Boolean Values¶
/*The values true and false are not strings. If you use quotes to
surround booleans ("true" and "false"), those values become strings.*/
console.log(typeof true);
console.log(typeof "true");
//boolean
//string
Example 2: 5.1.1. Boolean Values¶
/*There are only two boolean values---true and false. JavaScript is
case-sensitive, so True and False are not valid boolean values.*/
console.log(true);
console.log(typeof true);
console.log(typeof false);
//true
//boolean
//boolean