Comparison with the Strict Equality Operator for me

Comparison with the Strict Equality Operator for me
0

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

// Change this value to test
testStrict(7);

i need help with this


#2

I’ve edited your post for readability. When you enter a code block into the forum, remember to precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


#3

What does the failing test say? Right now your function will always return 'Equal' because you are testing whether val is equal to itself. Is this the challenge requirement?


#4


thanks, i got it


#5

// Setup
function testStrict(val) {
if (val === ‘10’) { // Change this line
return “Equal”;
}
return “Not Equal”;
}

// Change this value to test
testStrict(10);

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

// Change this value to test
testStrict(7);

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

// Change this value to test
testStrict(“7”);