showing results for - "javascript test strict equality"
Elías
29 Jul 2017
1// If you try to test if the number 5 
2//is equal to the string “5” the result is true. 
3var a = 5; 
4var b = "5"; 
5if ( a == b) --> true
6//That’s because JavaScript figures out the value 
7//of this string is five, and five is the same as five, 
8//so therefore a equals b.
9
10//But if you ever need to test to see 
11//if two things are identical, three symbols is the way to go. 
12var a = 5; 
13var b = "5"; 
14if ( a === b) --> false