Comparison Operators

PHOTO EMBED

Thu Jul 28 2022 14:05:17 GMT+0000 (Coordinated Universal Time)

Saved by @codewithapollo #javascript

- Equal (==)
- if the value is same returns true, else false 
- number == string; returns true         
var a = 20; 
var b = "20";
a == b; true

- Strict equal (===)
- if the value and is same returns true, else false
- number === number, string === string returns true
var a = 20;
var b = 20;
a === b; true
var a = 20;
var b = "20";
a === b; false

-Not equal (!=)
- if the value is not the same returns true, else false        
var a = 5; 
var b = 4;
a != b; true  
            
Strict not equal (!==)            
- if the value is not the same return true, else false
- number to number, string to string returns true
var a = 2;
var b = "2";
a !== b; true 
         
        
content_copyCOPY