input: Write a function to filter an array by a given criteria. The criteria is a function that specifies whether an element should be included in the resulting array. If the criteria function returns True for an element, that element should be included in the filtered array. If the criteria function returns False, that element should be excluded from the filtered array.
  
  def filter_array(array, criteria):
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_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([1, 2, 3, 4, 5], lambda x: x % 2 == 0) == [2, 4]
output: def filter_array(array, criteria):
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array