A question regarding the instructions, which give the following examples:
Examples
1 != 2 // true
1 != "1" // false
1 != '1' // false
1 != true // false
0 != false // false
My question is why are #4 and #5 false? 1 does not equal true, which is a true statement; 0 does not equal true, which is also a true statement.
Your code so far
// Setup
function testNotEqual(val) {
if (val) { // Change this line
return "Not Equal";
}
return "Equal";
}
testNotEqual(10);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Challenge: Basic JavaScript - Comparison with the Inequality Operator
Link to the challenge: