input: Write a function to filter an array by a given criteria and return the filtered array. If the criteria is `x % 5 == 0`, the function should return only elements of the array that are divisible by 5. If the array is empty, it should return an empty array.
  assert filter_array([1, 2, 5, 10, 15, 20, 25, 30], lambda x: x % 5 == 0)==[5, 10, 15, 20, 25, 30]
  assert filter_array([3, 7, 11, 14, 19], lambda x: x % 5 == 0)==[]
  assert filter_array([], lambda x: x % 5 == 0)==[]
output: def filter_array(arr, criteria):
      return [x for x in arr if criteria(x)]