Object spread vs megamorphism

17 views
Skip to first unread message

Paweł Badeński

unread,
Jun 26, 2020, 1:14:37 PM6/26/20
to v8-users
Hi,

Am I correct in thinking that there's an inherent conflict in using spread syntax & performance (penalty caused by megamorphism)?

Example below:

const object = { a: 1, b: 2, c: 3 };
const modifiedObject = { ...object, b: 2 };
const evenMoreModifiedObject = { ...object, a: 2 };

Thanks,
Pawel
Reply all
Reply to author
Forward
0 new messages