Object.assign vs Object Spread in Node.js
Test it yourself:
- clone the repo
- run installation using
yarn
- run
npm start
Up to this day, using Node.js v10.16.3 - you'll get the output:
Object spread x 3,003,908 ops/sec ±1.32% (88 runs sampled)
Object.assign() x 24,988,830 ops/sec ±1.18% (88 runs sampled)
Object.assign() is faster 🤯