I have an array of objects with a property I want to filter on called "Country". I have the user select which countries they want to see and wish to return an array of objects filtered by that property. What is the most efficient way to complete this process?
var countries = [{GINI: 56.2, Country: "Central African Republic", Values: Array, Date: "2008"},
{GINI: 51.3, Country: "Brazil", Values: Array, Date: "2015"},{GINI: 51.1, Country: "Columbia", Values: Array, Date: "2015"}]
var selectedCountries = ["Central African Republic", "Columbia"];
var filteredCountries = countries.filter(country =>{
??
});
Output should be a filtered version of the countries array containing the matches