Answers for "change string array to int array java script"

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
0

how to change array element to integer in js

var res = ['2', '10', '11'].map(v => +v );

document.write('<pre>' + JSON.stringify(res, null, 3) + '<pre
Posted by: Guest on July-13-2021

Code answers related to "change string array to int array java script"

Code answers related to "Javascript"

Browse Popular Code Answers by Language