Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 12 lines (8 sloc) 300 Bytes
type ForEachCallback<T> = (value: T, index: number, array: T[]) => void;
export function forEach<T>(array: T[], callback: ForEachCallback<T>) {
const { length } = array;
for (let index = 0; index < length; index += 1) {
const value = array[index];
callback(value, index, array);
}
}
You can’t perform that action at this time.