Answers for "how to filter through array extracting only numbers in js"

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
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 "how to filter through array extracting only numbers in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language