Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to convert all elements in an array to integer in JavaScript?

let arr = ['4', '9', '966']
arr = arr.map(e=>Number(e));

console.log(arr)// [4, 9, 966]
 
PREVIOUS NEXT
Tagged: #How #convert #elements #array #integer
ADD COMMENT
Topic
Name
3+3 =