Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js nullish coalescing ?? vs logical or ||

The OR operator || uses the right value if left is falsy 
(e.g. "" or 0 or false), while the nullish coalescing operator ?? uses
the right value if left is null or undefined.
Source by stackoverflow.chttps #
 
PREVIOUS NEXT
Tagged: #js #nullish #coalescing #logical
ADD COMMENT
Topic
Name
6+3 =