dev-resources.site
for different kinds of informations.
“==” and “===” difference in javascript
Published at
6/30/2024
Categories
javascript
webdev
beginners
Author
sagar
In javascript both “==” and “===” used for comparison but they have purposes and behaviors
== (Double equal)
:
The == operator is used for loose equality comparison . When we compare with == it will only compare values not the data type means if we compare string of “5” and integer 5 the result will be true
console.log(5=="5") // true
console.log(5==5) // true
2. === (triple equal):
The === operator is used for strict equality comparison. As we studied == only compare values not data type but === compare both values and datatype means if we compare string of “5” and integer 5 the result will be false both values and data type must same
console.log(5=="5") // false
console.log(5==5) // true
Articles
12 articles in total
querySelector vs querySelectorAll in javascript
read article
Best Way to add Javascript file in HTML
read article
let, const , var difference in Javascript?
read article
forEach vs map method javascript
read article
What are AEM Components?
read article
4 ways to iterate over “objects” in javascript
read article
Hoisting in javascript ?
read article
“==” and “===” difference in javascript
currently reading
Common JavaScript "event Handler" Mistake
read article
What is Adobe Experience Manager(AEM) & it's Features
read article
What is CMS (Content Management System)?
read article
Clousers in Javascript?
read article
Featured ones: