Question: Challenge For the following problems, you will be using the comparison operators ( = = , = = = , < , > , <

Challenge
For the following problems, you will be using the comparison operators (==,===,<,>,<=,>=) to compare two variables and see if the comparison yields true or false. You will assign the resulting boolean to a variable. For example:
let first =7;
let second =8;
let isFirstBigger = first > second;
console.log(isFirstBigger); // should log: false
first =16;
isFirstBigger = first > second;
console.log(isFirstBigger); // should log: true
1. Compare small and large using the < operator. Assign the result to a variable called isSmaller.
2. Compare num and string. First, use the == operator to compare the two variables, and assign the result to a variable calledisLooselyEqual. Second, use the === operator to compare the variables; assign the result to a variable called isStrictlyEqual.
3. Compare isTrue and isFalse using the !== operator. Assign the result to a variable called isTrueNotFalse.
Continue to experiment with different comparison operators and data types. You can see a full list of comparison operators here.
Is it working? Check my answer
isSmaller should be true
isLooselyEqual should be true
isLooselyEqual is not defined
isStrictlyEqual should be false
isStrictlyEqual is not defined
isTrueNotFalse should be true
isTrueNotFalse is no

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!