About 8,710,000 results
Open links in new tab
  1. How to multiply a string as many as X times in JavaScript

    Apr 10, 2021 · This article will help you to learn how to use all three methods to multiply the string, starting from using the String.repeat() method. Multiply string using repeat () method

  2. javascript - Multiply a string in JS - Stack Overflow

    Oct 19, 2018 · You could use String#repeat instead of a multiplication of a string. This does not work for value who can not converted to a number.

  3. Why can I multiply a string in JavaScript, but not add it?

    Jun 30, 2023 · In javascript + is used for both math adding and string concatenation. If a value is of type string, javascript assumes you are appending the strings together. Just convert both …

  4. algorithm - Javascript multiplying strings - Stack Overflow

    Dec 1, 2019 · Just convert to Numbers, multiply, and then convert back to a string. function mult(a, b){ return (Number(a) * Number(b)).toString(); } In JavaScript, ints are not a specific …

  5. How to Multiply a String in JavaScript - Sabe.io

    Oct 22, 2022 · In this post, we looked at three ways to multiply a string in JavaScript. Your options are to use the built-in repeat() method, use a for loop, or use a while loop.

  6. How to Multiply Strings JavaScript - Itsourcecode.com

    Aug 25, 2023 · In this article, you are going to learn how to multiply a string in JavaScript with the different methods and best practices. Whether you intend to repeat a certain string multiple …

  7. Common Mistakes When Multiplying Values in JavaScript

    May 25, 2024 · One common mistake is attempting to multiply strings, expecting a repetition of the string. For example: The result of this operation is NaN because JavaScript does not …

  8. JavaScript String Multiplication Performance Exploration

    Nov 18, 2007 · Since JavaScript concatenates strings with the + operator, it would be nifty if it would also let you multiply strings using e.g. str * 10 (as can be done in Python, at least). …

  9. Operators That Multiply and Divide - Intro to Programming with JavaScript

    When you multiply a number and a string the string will be converted to a number by JavaScript. Even when you multiply a string by a string JavaScript will convert the strings to numbers, if it …

  10. javascript - Multiply strings - Stack Overflow

    Jul 19, 2018 · If you are trying to multiply two strings, then your code meets integer overflow issue. You shouldn't compute the result product in an integer, just use a string as a container …

  11. Some results have been removed
Refresh