// for young people const youngPeople = users.filter((person) => { return person.age <= 15; }); //for senior people const seniorPeople = users.filter((person) => person.age >= 50); console.log(seniorPeople); console.log(youngPeople);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter