Return type should be a array.
findMatches(
[
{"X" : "1", "Y" : "2","Z" : "4", "P" : "5"},
{"X" : "2", "Y" : "2","Z" : "4", "P" : "5"},
{"X" : "1", "Y" : "2","Z" : "9", "P" : "6"}
],
{"X":"1", "Y":"2"}
);
Should return
[
{"X" : "1", "Y" : "2","Z" : "4", "P" : "5"},
{"X" : "1", "Y" : "2","Z" : "9", "P" : "6"}
]
Answer should be valid for any given input.
function findMatches(arr ,obj) {
return [];
}
findMatches(
[
{"X" : "1", "Y" : "2","Z" : "4", "P" : "5"},
{"X" : "2", "Y" : "2","Z" : "4", "P" : "5"},
{"X" : "1", "Y" : "2","Z" : "9", "P" : "6"}
],
{"X":"1", "Y":"2"}
);