DEV Community

Discussion on: Array Iteration for Beginners

Collapse
 
phamphong profile image
phamphong

let list = [1,2,3,4,5]
function greaterThanThree(num){
return num > 3
}
list.filter(greaterThanThree) // => [4,5]