I have an array of objects. Every object has a double value. Before using the list, I want to remove all objects with the value 0.0 from it, How to do it? As you can see in this example, the object with the PM10 key has the value 0.0. I want to delete this object and every entry with this value if the list changes.
dataEntries =
[
FavoriteData(id: 0, key: "NO2", values: [FavoriteValue(date: "", value: 40.0)]),
FavoriteData(id: 0, key: "PM10", values: [FavoriteValue(date: "", value: 0.0)]),
FavoriteData(id: 0, key: "PM2.5", values: [FavoriteValue(date: "", value: 55.0)]),
FavoriteData(id: 0, key: "O3", values: [FavoriteValue(date: "", value: 17.0)]),
FavoriteData(id: 0, key: "NO2", values: [FavoriteValue(date: "", value: 40.0)]),
FavoriteData(id: 0, key: "C6H6", values: [FavoriteValue(date: "", value: 10.0)])
]