user1
: which contains an objectuser2
: which contains null
undefined
when accessing a property of an object that does not exist. In cases where the user
is unavailable, we display "User not available".null
with the use of the optional chaining operator and conditional rendering in the React and Types lessonObject.keys()
, Object.values()
and Object.entries()
.
We also use optional chaining (?.
) to display the properties of an object: