DEV Community

Discussion on: Filter Arrays with the Javascript Filter() Method

Collapse
 
vier31 profile image
Jan Schröder

You would need to put the if statement in the callback of the filter()

const oddSqrRoots = numbers.filter(num => num % 2 != 0)