I want to delete a object on my objects array, but i cant find a better way than using some loop to do such a thing, on each object we have an ID
example:
var array = [{
id : String,
price : Number,
someOtherVars : String
}]
var element = {
id : "00dks",//this is a unic value
price : 12,
someOtherVars : "some value"
}
var element2 = {
id : "a43sdk",
price : 30,
someOtherVars : "some value"
}
var element3 = {
id : "0as0d",
price : 122,
someOtherVars : "some value"
}
array.push(element);
array.push(element2);
array.push(element3);
so... what is the most efficient way of doing this?
ps: i'm looking for a way to access the element by the key with out using any kind of loop, like the function .find(), example array["0as0d"]
, to get element3