How to use 'regex repeat n times' in JavaScript

Every line of 'regex repeat n times' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
208export function repeat(toRepeate: string, numberOfTimes: number): string {
209 return Array(numberOfTimes + 1).join(toRepeate);
198function repeat(toRepeate, numberOfTimes) {
199 return Array(numberOfTimes + 1).join(toRepeate);

Related snippets