Last entry of array (v3)

Revision 3 of this benchmark created on


Description

Get the last entry of array

Setup

let arry = Array(10000).map((entry,idx) => idx*2);

Test runner

Ready to run.

Testing in
TestOps/sec
length
let lastElement = arry[arry.length-1];
console.log(lastElement)
ready
slice
let lastElement = arry.slice(-1)[0];
console.log(lastElement)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.