Not Recognizing Strict Equality Symbol

Tell us what’s happening:

Describe your issue in detail here.
It won’t recognize the strict equality symbol, It can recognize when it’s not there and this is the only error. Thanks in advance

Your code so far

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

testStrict(10);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0 (Edition GX-CN)

Challenge Information:

Basic JavaScript - Comparison with the Strict Equality Operator

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more you say, the more we can help!

Hey @wenyunt
Remove the brackets enclosing the variable “val”

Good work so far

2 Likes

Thanks! Don’t really get why this works but if it works then don’t question it.

It’s really a bug in the tests. Putting val in parens like you did doesn’t do anything and the code “should have” passed. But you absolutely do not need to put val in parens, and in the real world, no professional would put val in parens here, and thus the tests weren’t expecting val to be in parens and got confused and wouldn’t let you pass.

Moral of the story, only use parens when absolutely necessary if you want to make the tests happy :slight_smile: