Outline

In the exercise for this section, you were supposed to determine the output for 5 comparisons. Here are the answers for this exercise, along with examples of how to double check your answers.

const anchoviesPizzaScore = 0;
const pepperoniPizzaScore = 4;
const hawaiianPizzaScore = 4;
const chickenBaconRanchPizzaScore = 6;

// Determine the output of each of the following comparisons

// 1. anchoviesPizzaScore < pepperoniPizzaScore
console.log(anchoviesPizzaScore < pepperoniPizzaScore);

// 2. chickenBaconRanchPizzaScore > hawaiianPizzaScore
console.log(chickenBaconRanchPizzaScore > hawaiianPizzaScore);

// 3. hawaiianPizzaScore > pepperoniPizzaScore
console.assert(hawaiianPizzaScore > pepperoniPizzaScore, 'This is not true');
console.log(hawaiianPizzaScore > pepperoniPizzaScore);

// 4. pepperoniPizzaScore <= chickenBaconRanchPizzaScore
console.log(pepperoniPizzaScore <= chickenBaconRanchPizzaScore);

// 5. hawaiianPizzaScore >= pepperoniPizzaScore
console.log(hawaiianPizzaScore >= pepperoniPizzaScore);

You can view the answers in this StackBlitz project.

 

I finished! On to the next chapter