Javascript
JavaScript Fundamentals -- Logical and Comparison Operators

Logical Operators -- Or Exercise

Mute
Current Time 0:00
/
Duration Time 0:00
Loaded: 0%
Progress: 0%
Stream TypeLIVE
Remaining Time -0:00
 
PRO

For the exercise for this section, complete the expression or determine what its output will be

// 1. '0' || null

// 2. What is the value of name?
const name = '' || null || 3 || 'Jason';

// 3. Provide values for val1 and val2 so that you enter the if statement.
const val1;
const val2;
if (val1 || val2) {
  console.log('You made it into the if statement')
}

Fork this StackBlitz project to do the exercise.

 

I finished! On to the next chapter