Move element by Array.splice() vs Move element by Array.copyWithin()Fastest: Move element by Array.splice() (9.9x faster)
2,244,862 ops/sec
227,825 ops/sec
Fastest: Move element by Array.copyWithin() (2.0x faster)
3,308,300 ops/sec
1,641,769 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Move element by Array.splice() | |
| Move element by Array.copyWithin() |
| Test name | Executions per second |
|---|---|
| ✓ Move element by Array.splice() | 2,164,525 Ops/sec |
| Move element by Array.copyWithin() | 241,711 Ops/sec |