Comparison with the Equality Operator

Comparison with the Equality Operator
0

#1

Tell us what’s happening:

Your code so far

if ("12" == 10) {
return "Equal";
}
return "Not Equal";
}

function testEqual(myval) {
if (10 == 12) {
return "Equal";
}
return "Not Equal";
}```
**Your browser information:**

Your Browser User Agent is: ```Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0```.

**Link to the challenge:**
https://www.freecodecamp.org/challenges/comparison-with-the-equality-operator

#2

This challenge solution will be like:


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

// Change this value to test
testEqual(12);

Here as explained in challenge, we can compare two different data types with ==. where only values are compared.
but if you search for comparison operator like ===, this will be used to check both data type and value also for comparison.