Réponse
dot notation, bracket notation
Colonne
Explication
Attention : We *must* use bracket notation when accessing keys that have numbers, spaces, or special characters in them. his can also be helpful when working with functions:
let returnAnyProp = (objectName, propName) => objectName[propName];
returnAnyProp(spaceship, 'homePlanet'); // Returns 'Earth'
Question
Pour un objet littéral, quelles sont les 2 notations pour accéder à sa propriété ?
Thématique






