DEV Community

asiddharth94
asiddharth94

Posted on

2 2

repeat() - JavaScript

The repeat() is called on a string which takes one argument (number of times the string needs to be repeated) and returns a new string , containing the repetitions of the string on which it was called (argument times), concatenated together.

Note - The argument passed must be non-negative and the new string formed must not overflow the maximum string size.

'#'.repeat(3) returns '###'

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay