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

Lines changed: 16 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy