Nullish coalescing, javascript new features 2020

Published: 21 February 2020
on channel: Shrideep ghag
170
6

Nullish coalescing, javascript 2020

The nullish coalescing operator (??) is a logical operator that returns its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side operand.

Earlier, when one wanted to assign a default value to a variable, a common pattern was to use the logical OR operator (||)
This works well for the common case of null and undefined values, but there are a number of falsy values that might produce surprising results
The nullary coalescing operator is intended to handle these cases better and serves as an equality check against nullary values (null or undefined).

Supported Browsers
chrome v80 and firefox v72

----
Follow Me Online Here:

Twitter:   / shrideepghag  
GitHub: https://github.com/Shrideep
LinkedIn:   / shrideep-ghag-4a665251  
Instagram:   / shrideep.ghag  


Watch video Nullish coalescing, javascript new features 2020 online without registration, duration hours minute second in high quality. This video was added by user Shrideep ghag 21 February 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 170 once and liked it 6 people.