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) 346 Bytes
type EveryCallback<T> = (value: T, index: number, array: T[]) => boolean;
export function every<T>(array: T[], callback: EveryCallback<T>) {
const { length } = array;
for (let index = 0; index < length; index += 1) {
const value = array[index];
if (!callback(value, index, array)) {
return false;
}
}
return true;
}
You can’t perform that action at this time.