Skip to content

Commit b47094b

Browse files
committed
Add more console in null & undefined.
1 parent eaf45b4 commit b47094b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

05_Operators.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@
4242

4343
// null vs undefined -
4444

45-
console.log(!null); // true (null is falsy value, i.e., it converts to false in boolean context)
46-
console.log(!!null); // false (double negation converts to boolean and then negates it, i.e., it converts to true and then negates it to false)
45+
console.log(null); // null
46+
console.log(!null); // true
47+
console.log(!!null); // false
4748

48-
console.log(!undefined); // true (undefined is falsy value, i.e., it converts to false in boolean context)
49-
console.log(!!undefined); // false (double negation converts to boolean and then negates it, i.e., it converts to true and then negates it to false)
49+
console.log(undefined); // undefined
50+
console.log(!undefined); // true
51+
console.log(!!undefined); // false
5052

5153
console.log(null == undefined); // true
5254
console.log(null === undefined); // false

0 commit comments

Comments
 (0)