convert array to integer in javascript code example
Example 1: 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);
});
Example 2: convert array to number
let x = [1,2,3,4,5]
let num = +x.join("")
Example 3: integer to array javascript
Array.from(String(12345), Number);