File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 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
5153console . log ( null == undefined ) ; // true
5254console . log ( null === undefined ) ; // false
You can’t perform that action at this time.
0 commit comments