1

Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?

Not really relative to any type of code, just in general?

Community
  • 1
  • 1
nkcmr
  • 10,690
  • 25
  • 63
  • 84

3 Answers3

6

usually === also represents equality of type.

so:

   1 == "1" //true
   1 === "1" //false
Naftali
  • 144,921
  • 39
  • 244
  • 303
3

=== is the identical operator; it returns true when both the value and the type of the two operands are the same. == is the equal operator; it does not check types, just values.

Read more here.

Jon
  • 428,835
  • 81
  • 738
  • 806
1

=== compares the value as well as type of variable
== doesn't compare type

simshaun
  • 21,263
  • 1
  • 57
  • 73