Basic JavaScript - Comparison with the Strict Equality Operator

// Setup
function testStrict(val) {
  if (val === 7) {
    // Change this line
    return "Equal";
  }else{
     return "Not equal";
  }
  
}

testStrict(10);
testStrict(7);
testStrict("7")

I provided this code and when I put a console log on testStrict(10); it also given the correct output, but course says ```
testStrict(10) should return the string Not Equal
but my console.log(testStrict(“7”)); prints Not equal.
this not allow me to go forward. please help me

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Reread the error message more carefully

Now read what you wrote very carefully.

Every single letter including capitalization needs to match and right now it doesn’t

1 Like

hello and welcome to fcc forum :slight_smile:

  • "Not equal" is not same as “Not Equal”

hope this was helpful, happy learning :slight_smile:

1 Like

Thank you so much for the response

Thank you so much for the response and kindness.

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