Answers for "numbers to array"

8

how to convert string to int a array in javascript

var a = "1,2,3,4";

var b = a.split(',').map(function(item) {
    return parseInt(item, 10);
});
Posted by: Guest on November-15-2019
10

javascript Convert an array of strings to numbers

const toNumbers = arr => arr.map(Number);
toNumbers(['1', '2', '3','4']);     // [1, 2, 3, 4]
Posted by: Guest on July-02-2020
4

convert array to number

let x = [1,2,3,4,5]
let num = +x.join("")
Posted by: Guest on August-19-2020
1

number to number array

public int[] IntegerArrayNum(int num)
    {
        var ls = new List<int>();
        foreach ( var i in num.ToString().ToCharArray())
        ls.Add(Convert.ToInt32(i.ToString()));
        return ls.ToArray();
    }
Posted by: Guest on September-16-2021

Code answers related to "numbers to array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language