Javascript Relational Operators Question 1

Introduction

What is the output of the following code?

let userAge = 12;

if ((userAge > 0 && userAge < 10) || (userAge > 80))
    console.log("You're either very young or very old!");
else {
    console.log("Your age is right around the middle.");
}


Your age is right around the middle.

Note


let userAge = 12;

// This conditional checks is the user is between 0 and 10 years old, or over 80
if ((userAge > 0 && userAge < 10) || (userAge > 80))
    console.log("You're either very young or very old!");
else {//from www  . j a va2  s  .c  om
    console.log("Your age is right around the middle.");
}



PreviousNext

Related