1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Use the Optional Chaining Operator to Simplify Checking for Nullish Values

    javascriptJavaScript

    The Optional Chaining Operator, ?., can be used as a simple way to check if a variable has a nullish value (null or undefined). Instead of littering your app with checks like data && data.movies, you can write data?.movies instead.

    Check out the Optional chaining MDN docs to read more about the new operator.