0
Modify my String so it will equal "world" 5 times help
function repeatString(stringToRepeat: string, numTimes: number) { let result =" "; for(let i = 0; i < numtimes; i++) { result += stringToRepeat; } return result ; } let myString = repeatString();
1 Respuesta
+ 9
function repeatString(stringToRepeat, numTimes) {
let result ="";
for(let i = 0; i < numTimes; i++) {
result += stringToRepeat;
}
return result ;
}
let myString = repeatString("world",5);