Solved problem 1

This commit is contained in:
Mohammed Nabeel 2020-07-02 09:27:26 +03:00
parent 5c39ba4078
commit f9b8d2d403
2 changed files with 43 additions and 32 deletions

View File

@ -1,4 +1,15 @@
const repeatString = function() { const repeatString = function(sourceString, stringCount) {
//Declare variable/s
let resultString = '';
// Create a for loop to repeat the string
for (let i = 0; i < stringCount; i++) {
resultString = resultString + sourceString;
}
return resultString;
} }