Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53
Chrome 88
Windows
Desktop
3 years ago
Test name Executions per second
map 8697651.0 Ops/sec
for 1648843.1 Ops/sec
HTML Preparation code:
AخA
 
1
<script>
2
  const arr = [x => x + 1, y => y + 2, z => z + 3]
3
</script>
Tests:
  • map

     
    arr.map(fn => fn(100))
  • for

     
    for (let i = 0; i < arr.length; i++) { arr[i](100) }