You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
269 B
10 lines
269 B
3 years ago
|
import constant = require('lodash/constant');
|
||
|
import times = require('lodash/times');
|
||
|
|
||
|
/**
|
||
|
* Returns a new array of length count, filled with the given value.
|
||
|
*/
|
||
|
export function arrayRepeat<T>(count: number, value: T): T[] {
|
||
|
return times(count, constant(value));
|
||
|
}
|