array = [{"shop":"Big Store", "name":"Green Bag"}, {"shop":"Long Store", "name":"Red Shoes"}, {"shop":"Big Store", "name":"White Tree"}]Para filtrarlo, hice esta función.
function filterByShop(array, key, String) { return array.filter((obj) => obj[key] == String) }; Si hago alert(JSON.stringify(filterByShop(array, "shop", "Big Store"))) , devuelve la matriz menos el elemento Long Store .
Sin embargo, si adjunto la matriz filtrada a una ventana emergente de folleto a través de esta función, regresa como undefined
function shopsPopup(feature, json){ json.bindPopup(feature.properties.shop + "</br>" + feature.properties.name + "</br>" + JSON.stringify(filterByShop(array, "shop", feature.properties.shop))) }