Meaning of === operator in javascript

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

 

for sample

if (c === 0){
   //
}

What is the meaning of === here in above ex?

1 Answer

+1 vote
answered Dec 13, 2012 by sahana (2,250 points)

it checks that c is equal to the number 0. === is the strict equality operator. It does not attempt to type coerce the operands.

For example:

0 == false; //true (false coerces to 0)
0 === false; //false (no type coercion)
...