input: Write a function to filter an array by a given criteria. The function should take an array and a criteria function as inputs and return the filtered array where elements match the criteria. If the array is empty, the function should 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, 12, 13, 18], criteria)==[]
  assert filter_array([5, 10, 15, 20], criteria)==[5, 10, 15, 20]
  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