Comparison with the Equality Operator legia

Tell us what’s happening:
Hi I passed the test but I wonder how do the computer knows that 12 is equal to val when its not a number?

Your code so far


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

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator

In the compiler it searchers back up to the last time the variable was changed and comes back and uses that.

Thank you guys :slight_smile: