Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Linux
Desktop
one year ago
Array forEach, callback function provided as an argument, ignoring most callback arguments
5.6M/s
Array forEach, callback function provided as an argument
5.6M/s
for..in
4.7M/s
for loop
3.4M/s
Array forEach, callback function provided as a predefined variable
3.4M/s
for..of
733K/s
View exact numbers
Test name Executions per second
Array forEach, callback function provided as an argument, ignoring most callback arguments 5,601,961 Ops/sec
Array forEach, callback function provided as an argument 5,600,143 Ops/sec
for..in 4,747,800 Ops/sec
for loop 3,430,163 Ops/sec
Array forEach, callback function provided as a predefined variable 3,423,975 Ops/sec
for..of 733,335 Ops/sec
Script Preparation code:
Tests: