Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript Convert an array of strings to numbers

const toNumbers = arr => arr.map(Number);
toNumbers(['1', '2', '3','4']);     // [1, 2, 3, 4]
 
PREVIOUS NEXT
Tagged: #javascript #Convert #array #strings #numbers
ADD COMMENT
Topic
Name
1+5 =