Course lesson

Provide Default Values with Optional Chaining and Null Coalescing in JavaScript

JavaScript's optional chaining can be used to return prevent errors when accessing properties that do not exist. In order to return a useful value, we can combine optional chaining with null coalescing.

Duration
1 min
Access
Free
Transcript
Needs source

JavaScript's optional chaining can be used to return prevent errors when accessing properties that do not exist. In order to return a useful value, we can combine optional chaining with null coalescing.