javascript - Looping through an array of objects to display something specific -
i have multiple objects, represent different tv shows. stored in array. given specific attribute, x, want loop through array , display names of television shows given attribute, x.
for example, let's want display action tv shows. right now, can find objects not share genre, duration , rating (they equal).
how display item in array depending on 1 attribute?
as suggested in comments, array filter method should give want. here's start:
var filteredfilms = films.filter(function(film) { return parseint(film.duration) > 150 && film.genre === 'crime'; });
Comments
Post a Comment