Ajax-loader-large-white
Introduction to Objects I
We've come a long, long...

If yellow triangle warnings appear in the editor next to any code we provide in any exercise, it is fine to ignore them.

The very basic building block of JavaScript are primitive data types. We know of three primitives:

  • strings (e.g. "dogs go woof!")
  • numbers (e.g. 4, 10)
  • booleans (e.g. false, 5 > 4)

We learned about the use of comparators (eg. >, <=, !==, etc.). One really important thing to note is that any time comparisons are made, a Boolean value is returned.

Instructions

There is a long and ugly expression in the editor. Overall, it evaluates to a Boolean (i.e., either the entire statement is true, or it is false).

What does this expression in the editor evaluate to?

Declare a variable named answer. Assign to it the Boolean value that the expression evaluates to. Delete the default code in the editor and run your code.

?
Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

Focus on each element of the expression separated by the || ("OR") operator. You will see that there are three smaller expressions. Evaluate those smaller expressions first, then use them use three Booleans and determine the overall expression's Boolean value.

For each of the smaller expressions, ask yourself these questions:

  • Does 3 * 90 equal 270?

  • What's the opposite of false AND not-false?

  • If we turn "bex" into all-uppercase letters, will it be the same as "BEX"?

Since we're dealing with the || ("OR") operator here, if the first statement OR the second statement OR the third statement is true, the entire statement is true, and the value of answer should be true.

script.js