input: Write a function to filter an array by a given criteria. The function should take an array and a criteria function as input and return a new array containing only the elements that satisfy the criteria.
  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
  array = [1, 2, 5, 10, 15, 20, 25, 30]
  assert filter_array(array, criteria) == [5, 10, 15, 20, 25, 30]
  assert filter_array([], criteria) == []
  assert filter_array([3, 7, 9], criteria) == []
  assert filter_array([5, 15, 25, 35], criteria) == [5, 15, 25, 35]
output: def filter_array(array, criteria): 
   filtered_array = []
   for value in array:
    if criteria(value):
     filtered_array.append(value)
   return filtered_array