Run details:
Mozilla/5.0 (Linux; arm_64; Android 12; MNA-LX9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.109 YaBrowser/23.11.1.109.00 SA/3 Mobile Safari/537.36
Yandex Browser 23
Android
Mobile
2 years ago
for..of
11/s
.reduce
11/s
.reduce (destructuring)
10/s
.for (init array)
10/s
for..of (destructuring)
8/s
for..of (reduce)
7/s
.map (destructuring)
7/s
.map
6/s
.forEach
6/s
for..of (reduce) (destructuring)
3/s
View exact numbers
Test name Executions per second
for..of 11 Ops/sec
.reduce 11 Ops/sec
.reduce (destructuring) 10 Ops/sec
.for (init array) 10 Ops/sec
for..of (destructuring) 8 Ops/sec
for..of (reduce) 7 Ops/sec
.map (destructuring) 7 Ops/sec
.map 6 Ops/sec
.forEach 6 Ops/sec
for..of (reduce) (destructuring) 3 Ops/sec
Script Preparation code:
Tests: