userInformation is a plain JavaScript object:
{
id: "user-01",
email: "
[email protected]",
age: 25
}
You can access object properties in two standard ways:
Dot notation: object.propertyName
Bracket notation: object['propertyName']
Apply to each option:
A . userInformation.email
Correct dot notation; accesses "
[email protected]".
B . userInformation.get("email")
.get() is a method on Map instances, not on plain objects.
A regular object does not have a .get method; this would be TypeError.
C . userInformation["email"]
Correct bracket notation; string "email" is used as the property key.
Returns "
[email protected]".
D . userInformation[email]
Here email is treated as a variable, not a string literal.
Unless there is a variable named email defined with a value matching a property key, this will either:
Throw a ReferenceError (if email is not defined), or
Use the value of email as a computed key (not what is intended here).
It is not the correct way to access the "email" property literal.
Therefore, the correct ways are:
Answe r: A, C
Relevant concepts: object property access (. vs []), plain objects vs Map, literal property names vs computed property names.