input: Write a function to filter an array based on a given criteria. Return the filtered array containing only the elements that match the criteria. If the given array is empty, return an empty array.
  def filter_array(array, criteria):
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array
  
  def criteria(x):
      return x % 5 == 0
  
  assert filter_array([1, 2, 5, 10, 15, 20, 25, 30], criteria) == [5, 10, 15, 20, 25, 30]
  assert filter_array([3, 4, 7, 8, 9], criteria) == []
  assert filter_array([100, 55, 30, 25], criteria) == [100, 55, 30, 25]
  assert filter_array([], criteria) == []
output: def filter_array(array, criteria):
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array