JavaScript String function repeat() #javascript #repeat ( #shorts )

1 year ago
11

Hi Friends,

JavaScript String function repeat()

`repeat()` function creates a new string by repeating the original string with the given number of times to function `repeat()`.

let str = "Hello";
console.log(str.repeat(3)); // "HelloHelloHello"

let strWorld = "World";
console.log(strWorld.repeat(2)); // "WorldWorld"

#javascript #string #javascriptstring #javascriptlearning #javascriptinterview #javascriptstringfunctions #stringfunctions #stringrepeat #repeat #repeatinterview #trending #trend #popular #chat #chatgpt #gpt #gpt3 #gpt4 #shorts #interview #web #webdeveloper #development #developer #dev #interviewquestionsandanswers #question #answer #questionanswer #questionandanswer #shorts #trending #trend #popular #method #function #princecheema_official @princecheema_official ​

Loading comments...