ReactSensei

Boolean and Comparison Operators

January 22, 2020

temp-conversion.js

let temp = 32;
let isFreezing = temp <= 32;

console.log(isFreezing);

// Create age set to your age
let age = 65;
// Calculate is child - if they are 7 or under
let isChild = age <= 7;
// Calculate is senior - if they are 65 or older
let isSenior = age >= 65;
// Print is child value
console.log(isChild);
// Print is senior value
console.log(isSenior);
// Output --> true, false, true

© 2020