const friends = [ { name: "Abby", age: 22 }, { name: "Boby", age: 16 }, { name: "Coel", age: 20 }, { name: "Dany", age: 15 } ]; //who can drink? friends.filter(friend => friend.age >= 18);
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