Passed test 1
This commit is contained in:
parent
0f2c4f68b2
commit
2a41f84c1a
|
@ -1,4 +1,17 @@
|
||||||
const repeatString = function() {
|
const repeatString = function(string, number) {
|
||||||
|
|
||||||
|
let result = '';
|
||||||
|
|
||||||
|
for (let i = 0; i < number; i++) {
|
||||||
|
if (number < 0) {
|
||||||
|
return 'ERROR';
|
||||||
|
} else {
|
||||||
|
result += string;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue