Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (11 sloc) 335 Bytes
import { push } from './push';
export function slice<T>(array: T[], startIndex: number = 0, endIndex: number = array.length) {
const result = [];
for (let index = startIndex; index < endIndex; index += 1) {
const value = array[index];
if (index < array.length) {
push(result, value);
}
}
return result;
}
You can’t perform that action at this time.