Finding matching objects in an array of objects?

var set = [{"color":"blue"},{"color":"green"},{"color":"red"},{"color":"green"}];

I’d like to be able to do something like a db call, set.find({"color":"green"}) and have it return an array full of objects that contain that property.

35 thoughts on “Finding matching objects in an array of objects?”

Leave a Comment