Last entry of array

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

Revisions

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