Challenge 15

✒️

String Repeat

Open in Code Editor or Copy Instructions
...solutions at bottom of page...

Create a function to take a string as a parameter and a number of times to repeat it

Examples:

strRepeat("abc", 3) would return "abcabcabc"

strRepeat("😂", 5) would return "😂😂😂😂😂"

Extension:

Add validation for both parameters

Solutions

IGCSE 0478 / O-Level 2210 A-Level 9618