Confessions and Confusions of Ashok M A. Personal and Professional Blog.

Ashok Mannolu Arunachalam, How toStringJS

How to repeat a string in JavaScript

We can repeat a string using the repeat method.

const symbol = '*'
// **********

This comes handy in case we want to put some symbols around the page.^_^

.repeat(0) will return an empty string. So, by controlling the numbers we can decide whether to show those symbols or not.