Example:
const genre = {
"action": {
"rating": "8",
"movie": "John Wick"
},
"romance": {
"rating": "6.5",
"movie": "The Girl Next door"
}
}
For accessing the movies based on the 'Genre' we can use genre.action
But why genre?.action
also works. Can anyone explain I've seen people use this '?.' to access the JSON objects.
Thanks:)