How to get specific properties from array b. Those properties to be filtered are in array a.
Is there any easier way to do using underscore.
var a = [{
name: "code"
}, {
name: "barcode"
}, {
name: "status",
type: "button"
}];
var b = [{
id: 1,
code: 10,
barcode: "121212",
status: "success",
amount: "10",
available: true
}, {
id: 1,
code: 10,
barcode: "121212",
status: "success",
amount: "10",
available: true
}];
Now if using underscore how can I get below result
var c = [{
code: 10,
barcode: "121212",
status: "success"
}, {
code: 10,
barcode: "121212",
status: "success"
}];