Test case details

Preparation Code

const array = Array(500000) .fill(null) .map((_, i) => i);

Test cases

Test #1

const length = array.length - 1; for (let index = length; index > 0; index--) { const temp = array[index]; }

Test #2

let length = array.length - 1; while (length) { const temp = array[length--]; }

Test #3

const length = array.length - 1; for (let index = 0; index < length; index++) { const temp = array[index]; }