const songs[]; const results; for (var i, i++, i<songs.length){ if(song[i].artist == "Drake"){ result.push(songs[i]); }; // OR const songs []; const result = songs.filter ( song => song.artist == "Drake");
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