0

I am using java script to compare values

 if (cellValue == "true" || cellValue == true)

Instead of doing this can i use the ===operator in java script ?

1 Answers1

2

The difference between == and === is that the first one (double equals) does type coercion, which can lead to goofy results:

0 == false
true

0 === false
false

It is usually recommended to use === as that will provide more predictable results and evaluate the true types of the values you're comparing.

sma
  • 9,449
  • 8
  • 51
  • 80