Wednesday, June 24, 2009

Javascript Best Practices 4

Use Always === operator, instead of ==

The issue of this operator (==) is, if the variable are different types it does not compare. It's end up with javascript error.

But in this operator( === ) variable will be converted in to objects. and it will compare.

1)!=
2) ==

Bettor Coding use below opertor instead of above.

1)!==
2)===