Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 642 Bytes

repeat.md

File metadata and controls

34 lines (22 loc) · 642 Bytes

strings.repeat

repeat(string, count)

Repeat returns a new string containing the provided string copied and concatenated for the number of times given in the parameter

Arguments

  1. string (string): input string
  2. count (Number): number of times to repeat the string

Returns

(string): string containing the specified number of copies of the given string

Example

const result = strings.repeat('Moo', 3);
console.log(result);
> 'Moo Moo Moo '