Repeat a String Repeat a String - Portuguese (#34581)
Solution added to .md
This commit is contained in:
committed by
Jaka Kranjc
parent
55e7b07eb2
commit
7a0864d716
@ -63,6 +63,12 @@ repeatStringNumTimes("abc", 3);
|
||||
<section id='solution'>
|
||||
|
||||
```js
|
||||
// solution required
|
||||
function repeatStringNumTimes(str, num) {
|
||||
let result = '';
|
||||
for(let i = 0; i < num; i++) {
|
||||
result += str;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
```
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user