Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
Array.fill 116.8 Ops/sec
Array.from 139.2 Ops/sec
Tests:
  • Array.fill

    AخA
     
    new Array(200000).fill({ a: 1}).map(function(value, index) { return {...value, id: index}})
  • Array.from

     
    Array.from({length: 200000}, function(_v, index) { return { a: 1, id: index}})