Optional Chaining ?. operator in JavaScript
Optional chaining ?.
operator is used to access the nested object properties with implicit nullish check.
Optional chaining ?.
operator is used to access the nested object properties with implicit nullish check.
This is frequently asked question in JavaScript interview. We can compare primitive types, array and object using two comparison operators ==
and ===
available in JavaScript. This post describes the difference between these two with many examples.