Basic JavaScript: Practice comparing different values. I Needs help!

Basic JavaScript: Practice comparing different values. I Needs help!
0

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

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

please can anyone Explain this and what i should do cause i have been on this particular challenge for days trying several methods yet it’s not working out and i don’t know what else to apply to the code.:tired_face:


#2

Do you have a link to the exercise?


#3

No i don’t have, except but just the challenge alone


#4

Functions can take in parameters. You messed up the entire setup :slight_smile: Reset the challenge and start over

function func(param1, param2) {
  if (param1 < param2) {
    return true;
  }
  return false;
}

func(5, 7);
//returns true

Now try to figure out where you messed up.


#5

Thanks i got it right now.


#6

I have noticed most times that what the code challenge set and asked one do are usually different from the examples they use for the code. please why is it so? cause its confusing a times.


#7

The actual challenge typically wants you to have to think about what you are trying to do instead of just copying/pasting/modifying the example code.


#8

Hmmmmmmm::thinking::thinking: thanks