typescript: Use the Nullish Coalescing Operator in TypeScript

This lesson introduces the ?? operator which is referred to as nullish coalescing. The ?? operator produces the price at the right-hand aspect if (and provided that) the price at the left-hand aspect is null or undefined, making it an invaluable operator for offering fallback values.

We’re going to distinction the ?? operator with the || logical OR operator which produces the price at the right-hand aspect if the price at the left-hand aspect is any falsy price (reminiscent of null, undefined, false, "", 0, …).

Further Studying