Script Preparation code:
AخA
 
const arr = Array(1000000).fill(0).map((_, i) => i)
Tests:
  • Array.at()

     
    const val = arr.at(-1);
  • Index

     
    const val = arr[arr.length - 1];
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.at()
    Index

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 12 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Chrome 118 on Windows
View result in a separate tab
Test name Executions per second
Array.at() 71040160.0 Ops/sec
Index 64184620.0 Ops/sec