6 lines
137 B
TypeScript
6 lines
137 B
TypeScript
|
|
||
|
export function addNTimes<T>(array: T[], toAdd: T, times: number) {
|
||
|
for (let i=0; i<times; i++) {
|
||
|
array.push(toAdd);
|
||
|
}
|
||
|
}
|