We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5405aee + c6df3d9 commit 4f4b1b2Copy full SHA for 4f4b1b2
src/utils/arrayRepeat.ts
@@ -5,6 +5,10 @@
5
* // returns ["cyan", "red", "cyan", "red"]
6
*/
7
function arrayRepeat(array: string[], length: number = 0): Array<string> {
8
+ if (array.length === 0) {
9
+ throw new Error("Input array cannot be empty!");
10
+ }
11
+
12
const colorArray: Array<string> = [];
13
14
function repeatToLength(array: string[], length: number = 0): Array<string> {
0 commit comments