Https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

// Setup
function testNotEqual(val, a ) {
if (val != a ) { // Change this line
  return "Not Equal";
}
return "Equal";
}


console.log(testNotEqual(99, 99));
console.log(testNotEqual("99", "99"));
console.log(testNotEqual('12', 10));
console.log(testNotEqual(12, 10));
console.log(testNotEqual("bob", 10));
testNotEqual(99, 99);
testNotEqual("99", "99");
testNotEqual('12', 10);
testNotEqual(12, 10);
testNotEqual("bob", 10);
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36

Challenge: Comparison with the Inequality Operator

Link to the challenge:

I don’t understand what you’re asking. What do you need help with?

1 Like

“console.log” show my all condition are true, that means “Equal, Equal, Not Equal, Not Equal, Not Equal.” Last three condition are showing correct but why am showing first two condition are not correct.

You changed the function signature.

why yor function calls have two arguments and the tests only one argument?

Thank you for your answer. I think it’s right way for this test. If it is not help me for correct answer please.

No, it is not correct to change the function signature. The code specifically only wants you to change one line.

// Setup
function testNotEqual(val) {
  // DO NOT CHANGE ANYTHING EXCEPT FOR THIS LINE
  if (val) { // Change this line
  // DO NOT CHANGE ANYTHING EXCEPT FOR THIS LINE
    return "Not Equal";
  }
  return "Equal";
}

testNotEqual(10);

Thank you for your replay. I got it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.