String.prototype.repeat

Returns a string that is made from itself appended together the given number of times. If count is 0, the empty string is returned.

Syntax

repeat(count)

Parameters

Return value

The repeated string.

Examples

"na".repeat(3)
"nanana"
"na".repeat(0)
""