Answers for "filter out numbers from an array javascript string numbers"

1

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')
Posted by: Guest on April-20-2021

Code answers related to "filter out numbers from an array javascript string numbers"

Code answers related to "Javascript"

Browse Popular Code Answers by Language