PROGRAMMING

  MINTE9
REMEMBERS




Last update:   17-01-2022

Boolean

All comparitions operators return a boolean value.
 
/**
 * A comparition result can be assign to a variable, 
 * like any other value.
 */

console.log(2 > 1); // true
console.log(2 == 1); //false

let result = 2 > 1;
console.log(result); // true

Strict

! The strict equality operator leaves less room for errors.
 
/**
 * When comparing different types Javascript ...
 * converts the values to numbers.
 * 
 * A strict equality operator ====
 * checks the equality without type conversion
 */

console.assert( '2' > 1 ); // pass (Wrong)
console.assert( '01' == 1 ); // pass (Wrong)

console.assert( '01' === 1 ); // failed (Correct)

Questions     github Fundamentals
Conditional
        A B C D E F
🔔
1/1