What does the optional chaining operator (?.) do?

JavaScript Associate Easy

JavaScript Associate — Easy

What does the optional chaining operator (?.) do?

Key points

  • Distinguishes between error handling and default value substitution
  • Differs from promise chaining in its purpose and syntax
  • Focuses on property access rather than method invocation
  • Highlights the importance of null checks

Ready to go further?

Related questions