Match sub elements to main elements in array in javascript?

arrays

How to match the names of employees with the name of the manager who starts his name in the following letters. For example, director Ahmed and his staff Amjad, Amera and Amani, and so with the second manager Osama.