7 lines
146 B
TypeScript
7 lines
146 B
TypeScript
export function onEach<T>(value: T[], action: (it: T) => void): T[] {
|
|
for (const it of value) {
|
|
action(it);
|
|
}
|
|
return value;
|
|
}
|