How to create a string with a repeated character N times in TypeScript

1 Answer

0 votes
const repeated: string = '*'.repeat(10); // Repeats '*' 10 times

console.log(repeated);

 
    
/*
run:

"**********" 
      
*/

 



answered Jul 28, 2025 by avibootz
...