js
Object.create(proto, descriptors?)الـobject الجديد مفيهوش خصائص خاصة بيه؛ كل حاجة بيلاقيها في الـprototype اللي دايته. ده أنضف من new لما يكون الهدف الوراثة بس.
البرهان
js
const animal = { speak: () => 'صوت' };
const cat = Object.create(animal);
console.log(cat.speak(), Object.getPrototypeOf(cat) === animal, Object.hasOwn(cat, 'speak'));النتيجة
صوت true false