Results 1 to 7 of 7

Thread: Adding 1 in to each of array with Separators in javascript

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2021
    Posts
    16

    Question Adding 1 in to each of array with Separators in javascript

    Adding 1 to each in array from 1 to 15 maximum.
    with Numeric Separators .

    Code:
    var n = "11_11_11_11_11_11_11_11_11_11";
    var addone = "1";
    var maxNum = "15";
    var separator = "_";
    
    function addNum(n, separator, addone, maxNum) {
         return result.join("_");
    }

    Result
    Code:
    ... "11_11_11_11_11_11_11_11_11_12"
    ... "11_11_11_11_11_11_11_11_11_13"
    ... "11_11_11_11_11_11_11_11_11_14"
    ... "11_11_11_11_11_11_11_11_11_15"
    ... "11_11_11_11_11_11_11_11_12_1"
    ... "11_11_11_11_11_11_11_11_12_2"
    ... "11_11_11_11_11_11_11_11_12_3"
    Is it possible to add a large numbers with Separators ?
    Last edited by dday9; Jun 23rd, 2023 at 03:43 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width