Last entry of array (v2)

Revision 2 of this benchmark created on


Description

Get the last entry of array

Test runner

Ready to run.

Testing in
TestOps/sec
length
let arry = [2, 4, 6, 8, 10, 12, 14, 16];
let lastElement = arry[arry.length-1];
ready
slice
let arry = [2, 4, 6, 8, 10, 12, 14, 16];
let lastElement = arry.slice(-1)[0];
ready
at
let arry = [2, 4, 6, 8, 10, 12, 14, 16];
let lastElement = arry.at(-1);
ready

Revisions

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