Basic JavaScript - Comparison with the Equality Operator

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

Your code so far

function testEqual(val) {
  if (val == '12') {
    // Change this line
    return "Equal";
  }
  return "Not equal";
}
// Change this value to test
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:

Hi @ambreenabroabro

Welcome to FCC.

You should check whether val is equal to the number 12 not the string "12"

Are you sure it is supposed to be return "Not equal" or return "Not Equal"?

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