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