Answers for "turn an array of strings into integers javascript"

15

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
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

Code answers related to "turn an array of strings into integers javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language