In localStorage I set previously various objects which are stored in this format
console.log(localStorage)
// Outputs the storage this way, it may contain different objects (randid for example)
Storage {
876346545: "{"ABA":"876346545","ABB":"37578533567","ABC":"AE123456","ABD":"1234567890123456"}",
randid: "fhjidc06om230j2r367gh1i5iec",
353446545: "{"ABA":"353446545","ΑBB":"12343212341","ΑBC":"CC949590","ABD":"5943949562340543"}",
length: 3
}
I try to find if a specific pair exists in this array of objects for example
//Pseudo-code
if anyofObject in localStorage contains pair ("ABA":"876346545") return true or false
My code which does not do what I expect
var data = JSON.parse(localStorage) // I tried and without Parsing it as JSON
for (var key in data) {
if (data[key].ABA = "876346545") {
var m = data[key];
console.log("Found: ", m)
break;
}
}