Negative indices count backwards from the end of the array.
Returns undefined if index is fractional or NaN.
undefined
index
NaN
import * as A from "flurp/array";const indexTwo = A.get(2);indexTwo([3, 4, 5, 6, 7]); // 5const secondToLast = A.get(-2);secondToLast([3, 4, 5, 6, 7]); // 6
Negative indices count backwards from the end of the array.
Remarks
Returns
undefined
ifindex
is fractional orNaN
.Example