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 ;
let second ;
let isFirstBigger first second;
console.logisFirstBigger; should log: false
first ;
isFirstBigger first second;
console.logisFirstBigger; should log: true
Compare small and large using the operator. Assign the result to a variable called isSmaller.
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.
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
