Horje
javascript repeat function Code Example
javascript repeat function
/* The string.repeat(n) method constructs and returns a new string
with "n" number of copies. */

const chorus = "Because I'm happy. ";
console.log(`Chorus lyrics: ${chorus.repeat(3)}`);
// → "Chorus lyrics: Because I'm happy. Because I'm happy. Because I'm happy. "

// Use within a function
greeting = (n, words) => words.repeat(n);
console.log(greeting(5, "howdy ")); 
// → "howdy howdy howdy howdy howdy "
string repeat javascript
// best implementation
repeatStr = (n, s) => s.repeat(n);
repeat a function javascript
setInterval(function(){
  console.log("Hello");
  console.log("World");
}, 2000); //repeat every 2s




Javascript

Related
angular generate directive Code Example angular generate directive Code Example
array reduce and count based on proeperty js Code Example array reduce and count based on proeperty js Code Example
how to make react router Link active Code Example how to make react router Link active Code Example
commas for thousands js Code Example commas for thousands js Code Example
onclick change text color javascript Code Example onclick change text color javascript Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8