What is exactly meaning of “===” in javascript?

+3 votes
68 views
asked Dec 13, 2012 in java script by codeg (2,600 points)

What's the diff between "===" and "==" ? Thanks!

1 Answer

0 votes
answered Dec 13, 2012 by sahana (2,250 points)

'===' means equality without type coersion. In other words, if using the triple equals, the values must be equal in type as well.

e.g.

0==false   // true
0===false  // false, because they are of a different type
1=="1"     // true, auto type coersion
1==="1"    // false, because they are of a different type

Source: http://longgoldenears.blogspot.com/2007/09/triple-equals-in-javascript.html

...