- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path15_equality.js
More file actions
Latest commit
24 lines (19 loc) · 674 Bytes
/
Copy path15_equality.js
File metadata and controls
24 lines (19 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// == checks only value
// === checks only value and type
letvalue=6;
letvalue2='6';
letresult1=value!=value2;
letresult2=value!==value2;
// if number same with number use == , === will true for value
// but if value2 is '6' for != will false cz its string
// if number value1 6 and value2 '6' will false for != cz its not number
// but for !== is true cz not same remember !== read value and type
console.log(result1);//false
console.log(result2);//true
// example again
value='10';
value2=10;
result1=value==value2;//will true
result2=value===value2;//will false cz value and type differnt;
console.log(result1);
console.log(result2);