how to return a string x amount in javascript without using . repeat
function repeatStringNumTimes(string, times) {
var repeatedString = "";
while (times > 0) {
repeatedString += string;
times--;
}
return repeatedString;
}
repeatStringNumTimes("abc", 3);
Also in JavaScript:
- prevent form submission on onsubmit function calls
- how to delete element in list javascript
- const in javascript
- regular expression |
- JavaScript Operators
- npl live server doesn't load js
- location.reload sweetalert
- vue get height of element ref
- how many stacks are required for evaluation of prefix expression
- jest mockclear
- js windowresize event
- null is object in javascript
- jquery create element properties
- filereader check file type
- trigger input javascript
- convert nuber into string react js
- immediately invoked function expression
- js no new line console.log
- js change key value in object
- adding a default option in switch statements
- how to copy one array to another in javascript
- latest rn fatch blob package download
- javascrip reverse text
- Did you mean to use React.forwardRef()?