js multiply string
let string = 'Plumbus'
let count = 3
string.repeat(count); // -> 'PlumbusPlumbusPlumbus'var a="a";
var aaa=a.repeat(3); // "aaa"
function repeatStringNumTimes(string, times) {
var repeatedString = "";
while (times > 0) {
repeatedString += string;
times--;
}
return repeatedString;
}
repeatStringNumTimes("abc", 3);let myString = 'test';
myString.repeat(3); // 'testtesttest'
Also in JavaScript:
- node js sendgrid
- find class
- get attribute value jquery
- how to run electron and react using concurrently
- javascript loop an array check if a number is even
- jquery scroll to top of div
- react dictionary key value avec 2 variable
- search in a table jquery
- jquery vdn
- clone object in js
- datatable on error.dt
- implement the remove property function
- javascript select element in dropdown
- how to make a deck of cards in javascript
- creating react app using npx
- javascript see if chrome is in dark mode
- create array javascript fill
- react replace all line breaks with br
- react hooks update nested object
- get last element in array in javascript
- prototype chain in javascript
- how to remove last index of array in javascript
- content disposition attachment javascript fetch download "excel"
- equal to or more than javascript