I have an array of objects:
var arrObj = [
{ a: "11", b: "Test1" },
{ a: "22", b: "Test2" },
{ a: "33", b: "Test1" },
{ a: "44", b: "Test3" },
];
I want to check if an object with a certain value for property a
exists. If this exists then it should return the value of property b
.
The value of a
is always unique.
For example, if I am looking for "11"
, then it should return "Test1"
.