You need to test the value of the following variable in JavaScript.
var length = "75";
A block of code must execute if the length equals 75 regardless of the data type.
You need to use the statement that meets this requirement.
Which lines of code should you use? (Each correct answer presents a complete solution. Choose two.)
When comparison is made using double-equals operator (==), it will check the values of variable and convert them to a common type and returns true if both are equals. So comparing number with string having the same value will return true.
Examples:
examples:
1
console.log(23 == "23"); // true
2
console.log(1 == true); // true
Incorrect:
not ===: This is ''strict'' or ''identical'' equality.
Currently there are no comments in this discussion, be the first to comment!