Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

jump to level 1 if usernumber and comparenumber are not equal in value,…

Question

jump to level 1
if usernumber and comparenumber are not equal in value, display variables are not equal in value. if usernumber and comparenumber are not identical (strictly equal), display variables are not identical.
1 let comparenumber = 3; // code will be tested with: 3, 8, 42
2 let usernumber = \3\; // code will be tested with: \3\, 8, \hi\
3
4 / your solution goes here /
5

Explanation:

Step1: Check for non - equal value

Use the != operator to check if userNumber and compareNumber are not equal in value.

if (userNumber != compareNumber) {
    console.log("Variables are not equal in value");
}

Step2: Check for non - identical

Use the !== operator to check if userNumber and compareNumber are not identical.

if (userNumber!== compareNumber) {
    console.log("Variables are not identical");
}

Answer:

let compareNumber = 3;
let userNumber = "3";
if (userNumber != compareNumber) {
    console.log("Variables are not equal in value");
}
if (userNumber!== compareNumber) {
    console.log("Variables are not identical");
}