Last active
November 1, 2021 08:46
-
-
Save crutchcorn/76d5514d16b850b8aab3e0130893413c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const loopUntilAtLeastLength = (arr, wantedSize) => { | |
if (arr.length < wantedSize) { | |
return loopUntilAtLeastLength([...arr, ...arr], wantedSize); | |
} else { | |
return arr; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment