Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to filter through array extracting only numbers in js

//if its an array of objects
arr.filter((item) => typeof(item.key) === 'number')

//if its an array of values
arr.filter((item) => typeof(item) === 'number')
 
PREVIOUS NEXT
Tagged: #filter #array #extracting #numbers #js
ADD COMMENT
Topic
Name
4+2 =