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

12 lines
205 B
JavaScript

const repeatString = function(string, num){
if(num >= 0){
return string.repeat(num);
}
else{
return "ERROR";
}
};
// Do not edit below this line
module.exports = repeatString;