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
JS in Depth
XAH  BUY NOW

JS in Depth

JS Obj Ref

DOM


JS Obj Ref

String

prototype