QuestenaUn entraînement qui indique quoi revoir ensuite
Question 65

A new ordinary object is stored in person. The program executes person.name = "Ada" under normal writable conditions. What changes?

  1. person gains an own name property containing AdaBonne réponse
  2. A local variable named name is created
  3. The property is added only to person's prototype
  4. Nothing changes because missing properties cannot be assigned

Explication

Ordinary assignment through a previously absent name creates that name as an own property and stores the supplied value. It does not create a separate local binding named name, because the assignment target is a property access.

Continuer avec ce test

Commencer l’entraînement
Question 65: A new ordinary object is stored in person. The program… · JavaScript Fundamentals · Questena