Search
Complete the JavaScript function to find the first matching item in an array of objects based on a specified pattern. The function takes array and pattern as arguments and should return the matching item.
For example: