mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
7 lines
185 B
TypeScript
7 lines
185 B
TypeScript
export function takeWithRepeats<T>(things:T[], count: number) {
|
|
const result = [];
|
|
for(let i = 0; i < count; i++) {
|
|
result.push(things[i % things.length])
|
|
}
|
|
return result;
|
|
} |