Saturday, 12 November 2016

so easy to forget difference between ==and ===

1. if comparison is about number, string,

  •      same type, like comparison between number and number, result is same
  •      different type, number compared to string, for ==, it will transfer to same type then comparing value. for ===, value is false .because it just compares type.

!= does type conversion
!== doesn't do type conversion

No comments:

Post a Comment