New in ES2015.
String.prototype.repeat ( count )
this value to string, then return
count copy of it, joined together.
[see JS: “this” Binding]
console.log ( "a".repeat (2) ); // aa
- String Overview
- Template String ⭐
- Char, Code Unit, Codepoint
- String Escape Sequence
- Unicode Escape Sequence
Liket it? I spend 2 years writing this tutorial. Help me spread it. Tell your friends. Or, Put $5 at patreon.
If you have a question, put $5 at patreon and message me.