JavaScript: String.prototype.repeat

By Xah Lee. Date: . Last updated: .

New in JS2015.

String.prototype.repeat(count)

Convert this Binding to string, then return count copy of it, joined together.

console.log( "a".repeat (2) ); // aa
BUY
ΣJS
JavaScript in Depth

JS Obj Reference

String

prototype