Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 14 lines (9 sloc) 254 Bytes
export function reverse<T>(array: T[]) {
const result = [];
const lastIndex = array.length - 1;
for (let index = lastIndex; index > -1; index -= 1) {
const value = array[index];
result[lastIndex - index] = value;
}
return result;
}
You can’t perform that action at this time.