Improved code
This commit is contained in:
parent
1b39ae7f70
commit
04e21d84d9
|
@ -1,7 +1,8 @@
|
||||||
const repeatString = function(word, times) {
|
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);
|
arr.push(word);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue