Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript == vs ===

/**
* In js :
* == it convert the variable values to the same data type before performing comparison.
* example : comparison between string and interger data type
*/
(5 == "5") // returns true

// === it does not convert data type of variable before performing comparison.
// example:
(5 === "5") // return false
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
9+3 =