Improved code

This commit is contained in:
billalp 2019-11-04 22:00:12 +00:00
parent 1b39ae7f70
commit 04e21d84d9
1 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,8 @@
const repeatString = function(word, times) {
let arr = word.split(' ');
let arr = [];
for (let i = 1; i < times; i++) {
for (let i = 0; i < times; i++) {
arr.push(word);
}