i have two arrays variables in which each element is an object having some properties like this :
var employees = [{
name: 'Jack',
empId: 0,
age: 25,
orgId: 1
}, {
name: 'Lucifer',
empId: 1,
age: 35,
orgId: 2
}, {
name: 'Adam',
empId: 3,
age: 46,
orgId: 1
}, {
name: 'Eve',
empId: 4,
age: 30,
orgId: 3
}];
and the second variable is
var companies= [{
name: 'Microsoft',
id: 1,
employees: [5 , 9]
}, {
name: 'Google',
id: 2,
employees: [1]
}, {
name: 'LinkedIn',
id: 3,
employees: [10]
}];
so now i want that when i give a company name (for example: Google),then it will return the employee details. i want to do it by using filter()/reduce() method, but i am not able to do it . Help needed .. thank you