Answers for "js how to convert all string in array into integer"

13

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
1

js string array convert to int

let arrayOfNumbers = arrayOfStrings.map(Number);
Posted by: Guest on December-10-2021
0

js how to convert all string in array into integer

array = ['1','2','3']
arrayInt = array.map(Number)
//arrayInt = [1,2,3]
Posted by: Guest on March-18-2022
0

string array to int array javascript

//convert array to string first and use this code
var y =x.toString().split(',').map(Number)
Posted by: Guest on March-13-2022

Code answers related to "js how to convert all string in array into integer"

Code answers related to "Javascript"

Browse Popular Code Answers by Language