1let search = (needle, haystack, found = []) => {
2 Object.keys(haystack).forEach((key) => {
3 if(key === needle){
4 found.push(haystack[key]);
5 return found;
6 }
7 if(typeof haystack[key] === 'object'){
8 search(needle, haystack[key], found);
9 }
10 });
11 return found;
12};
13