/

HTML / CSS / JavaScript Tutorial

JavaScript String method: repeat()

[this page | pdf | back links]

The repeat() method (when applied to a JavaScript string) returns a string that repeats a specified string a specified number of times.

 

It has the following syntax with the following parameters:

 

string.repeat(n)

 

Parameter

Required / Optional

Description

n

Required

Number of times string is repeated

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript String Variables


Desktop view | Switch to Mobile