odin-default-js-exercises/repeatString/repeatString.js

13 lines
176 B
JavaScript

const repeatString = function(word, times) {
let arr = [];
for (let i = 0; i < times; i++) {
arr.push(word);
}
return arr.join('');
}
module.exports = repeatString