Problems with Practice comparing different values

Tell us what’s happening:

Dear All,
Good nights,
I ´m doing the chapter Practice comparing different values,
but sadly i am having problems with the challenge,
could anyone please help me ?
Thanks in advance,
Kind regards,
Ivonne

Your code so far


// Setup
function compareEquality ( a, b){
  if (a  === b) { // Change this line
    return " Not Equal ";
  }
  return " Equal ";
}

// Change this value to test
compareEquality( 10 , " 10 ");


function compareEquality(a, b){
  if (a  === b ){
    return " Not Equal";
  }
  return "Equal";
}
compareEquality ( "20", 20 );

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values

What problems are you having ?

the challenge is to learn the difference between == and ===

Dear @J1marotta,
Thanks for the quick reply, i am doing this challenge but it seems that i am
doing something wrong with my code, because always gives me as a result

compareEquality(10, “10”) should return “Not Equal”

compareEquality(“20”, 20) should return “Not Equal”

I know that i should use the strict equality operator and i used it , but i don´t know why i still have the same mistakes.:disappointed:

Do you actually have the function declared twice in your code?

that might be causing the error, try starting again and just changing the equality comparison.

Dear @J1marotta,
I made it, it was a small small change what i never have imagined i could do,
and the challenge was a success, i think i was writting too much things and finally
it was a simple change that should have done , i thank you for your advise,
and i am happy happy now :slightly_smiling_face:
have a wonderful night,
Kind regards,
Ivonne

glad to hear you did it!

congratulations.