This commit is contained in:
Angelos Chalaris
2017-12-27 11:02:46 +02:00
parent 37bb271221
commit 3d79413392
45 changed files with 89 additions and 91 deletions

View File

@ -5,9 +5,9 @@ Repeats a string n times using `String.repeat()`
If no string is provided the default is `""` and the default number of times is 2.
```js
const repeatString = (str="",num=2) => {
return num >= 0 ? str.repeat(num) : str;
}
const repeatString = (str = '', num = 2) => {
return num >= 0 ? str.repeat(num) : str;
};
// repeatString("abc",3) -> 'abcabcabc'
// repeatString("abc") -> 'abcabc'
```