Return the first matching value in an array