I have the following Javascript object
[
"{\"id\":\"b00a3a47-783a-4af5-90d9-59c4deb7a9e3\",\"notes\":\"sdfsdf\",\"recordType\":0}",
"{\"id\":\"a6f72972-502e-452b-9773-51699a527122\",\"notes\":\"sdfsfdf\",\"recordType\":0}"
]
how do I remove the element where ID = "a6f72972-502e-452b-9773-51699a527122"? (doesnt have to literally be "a6f72972-502e-452b-9773-51699a527122", thats just an example.
I have tried the following
var index = detailsArray.map(function (element) {
console.log("element = " + JSON.stringify(element) + " index = " + index + " id = " + element.id);
return element.id;
}).indexOf(detailId);
console.log("index of " + detailId + " = " + index);
delete detailsArray[index];
But it is returning element.id as undefined. I suspect its because the 'property' of the element is a String, i'm unsure how to solve this.
filter(). Code:var newArr = arr.filter(function(e) { return JSON.parse(e).id !== uglyId; });