Link Search Menu Expand Document

Comparison with the Equality Operator

Summary

  • The most basic operator is the equality operator == used to compare two items for equality.

Final Code

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

testEqual(10);