• Đăng ký
  • Đăng nhập

js filter array

📅 — 👀 44 — 👦
const ages = [32, 33, 16, 40];
const result = ages.filter(checkAdult);

function checkAdult(age) {
  return age >= 18;
}