2

My understanding of type coercion is that when the operands are of different data types, one of them will be converted to an "equivalent" value of the other operand.

x = true;

y = "true"; // This should be converted to boolean or should be truthy by default

if (x == y){console.log("Type coercion works")}
Dante
  • 537
  • 2
  • 4
  • 18

0 Answers0