Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15
Safari 12
Mac OS X 10.14.6
Desktop
5 years ago
Test name Executions per second
slice 1620778.1 Ops/sec
spread operator 1915647.4 Ops/sec
push apply into empty array 2253431.8 Ops/sec
Array.from 1404954.6 Ops/sec
Object.values 1183592.2 Ops/sec
For of push 2955744.0 Ops/sec
Array.contact 4791288.5 Ops/sec
Script Preparation code:
Tests:
  • slice

  • spread operator

  • push apply into empty array

  • Array.from

  • Object.values

  • For of push

  • Array.contact