Tell us what’s happening:
In this question it is asking " Add the equality operator to the indicated line so that the function will return the string Equal
when val
is equivalent to 12
". But if the value is equal to 12 and at the bottom argument for testEqual is 10 then how it can return the String “Equal”. It will return the string “Not Equal”. this question is needed to be update properly in my opinion.
Your code so far
// Setup
function testEqual(val) {
if (val == 12) { // Change this line
return "Equal";
}
return "Not Equal";
}
testEqual(10);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Comparison with the Equality Operator
Link to the challenge: