ES6 – Boolean Primitive Datatype
Boolean datatype which has either has
false as a value.
let isBigger = (3 > 2)
let isSmaller = (3 < 2)
The mathematical symbols
< are mostly used for comparison of data and values. They are also known as binary operators. Comparison statements using binary operators result boolean values. There is a list of ES6 – All Unary Operators you can checkout to learn more.
let isTrue = true
let isFlase = Boolean(false)
- Uppercase characters are smaller than lowercase characters
console.log(“Zoo” > “woods”)
console.log(“Zoo” > “Woods”)
console.log(NaN == NaN)
console.log(“NaN” == “NaN”)
// as string not as NaN datatype
boolean value is generated as the result.