mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
14 lines
284 B
JavaScript
14 lines
284 B
JavaScript
const repeatString = function(string,number) {
|
|
let fullString = "";
|
|
if (number < 0) {
|
|
return "ERROR";
|
|
}
|
|
for (i = 0; i < number; i++) {
|
|
fullString += string;
|
|
}
|
|
return fullString;
|
|
};
|
|
|
|
// Do not edit below this line
|
|
module.exports = repeatString;
|