I have an array of objects, something like this example:
var b = [
{
'attribute[170]': "41",
'attribute[171]': "15",
'data': 1,
'something': 'some text'
},
{
'attribute[150]': "401",
'attribute[181]': "5",
'test': '1234',
'data': 2.3
}
];
I want to select the object out of the array in b that contains the attributes of object a
var a = {
'attribute[170]': "41",
'attribute[171]': "15"
};
Is this possible, maybe with jQuery.grep or mapping? (I am using jQuery.)
a's properties match the entry fromb, right? So there'd be no match ifa'sattribute[171]were"42"instead of"15"given thebshown...