QuestenaПрактика, после которой понятно, что повторить
Вопрос 71

A source object has a nested details object. After an object-spread copy is made, which statement describes copy.details?

  1. It is omitted because spread copies only primitive values
  2. It is a recursively cloned object with no shared references
  3. It refers to the same nested object as source.detailsПравильный ответ
  4. It becomes inherited from the source object

Объяснение

Object spread copies enumerable own properties only one level deep, so the nested details value remains the same object reference. Calling this a recursive deep copy is the tempting mistake; later sources can also replace an earlier same-named property during spreading.

Продолжить работу с тестом

Начать тренировку
Вопрос 71: A source object has a nested details object. After an… · JavaScript Fundamentals · Questena