Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

duplicate text javascript

const duplicate = (string) => {
  const count = Number(
    prompt("How many times do you want to duplicate the text?")
  );
  return string.repeat(count + 1);
};

console.log(duplicate("Hello, World!"))
Source by www.textbotonline.com #
 
PREVIOUS NEXT
Tagged: #duplicate #text #javascript
ADD COMMENT
Topic
Name
5+3 =