Skip to content

Commit 8980e66

Browse files
authored
How to repeat a string
1 parent f533b66 commit 8980e66

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,23 @@ console.log( !!myVar ) // false
7373

7474
console.log( Boolean(mySecondVar) ) // true
7575
console.log( !!mySecondVar ) // true
76+
```
77+
78+
# How to repeat a string
79+
```javascript
80+
81+
let aliens = '';
82+
83+
for(let i = 0 ; i < 6 ; i++){
84+
aliens += '👽'
85+
}
86+
//👽👽👽👽👽👽
87+
88+
Array(6).join('👽')
89+
//👽👽👽👽👽👽
7690

7791

92+
'👽'.repeat(6)
93+
//👽👽👽👽👽👽
7894

7995
```

0 commit comments

Comments
 (0)