//array.filter(function(currentValue, index, arr), thisValue) const ages = [38, 23, 16, 40, 7]; const result = ages.filter(checkAdult); function checkAdult(age) { return age >= 18; } console.log(result) //output [ 38, 23, 40 ]