Skip to content
CodeWorth
CodeWorth

Code worths when shared

Primary Navigation Menu
Menu
  • BLOG
    • DataBase
    • Programming
    • Mobile
    • Multimedia
    • OS Tips
    • Others
    • Web Development
  • Products
    • Utilities
    • Games
    • JsGenLib
      • PlugIns
      • Core Functions
      • Helper & ShortHands
  • About

Javascript ==,!= Vs ===,!==

On February 3, 2011
In Web Development
Tagged JavaScript, Web
With 0 Comments
When validating javascript with tools like JSLint we often find only one repeated issue with == saying expected ===.

Let us clarify the difference between == and ===.
== is an equal operator which will return true when both operands are just same.
But === is strict equal operator which returns true only if the operands and their types are same
  1. check “2.0”==2 here will give true
  2. check “2.0”===2 here will give false
Similarly
  1. check “2.0”!=2 here will give false
  2. check “2.0”!==2 here will give true
2011-02-03

Subscribe

Enter your email address to receive notifications about new posts via email.

Join 634 other subscribers

Google

Designed using Chromatic WordPress Theme. Powered by WordPress.