I have a collection of objects that share this structure
[{ id: "11", name: "Car", symbol: "CA" }
,{ id: "13", name: "Cycle", symbol: "CY" }
,{ id: "15", name: "Train", symbol: "TA" }
,{ id: "3", name: "Ufo", symbol: "UF" }]
Suppose I have the string Car
, how can I search through the array of objects to identify which object, if any, contains that specific string in the name field and then remove that object from the array?
This is my current progress (Which is essentially nothing as I am unsure how to proceed)
function remove_obj_from_array_of_objs(str, array_of_objs){
}