input: Write a function to filter an array by a given criteria. The function should take in an array and a criteria function that returns True if the element matches the criteria, and False otherwise. The function should return a new array containing only the elements that match the criteria.
  
  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, 3, 5, 7, 9], lambda x: x % 2 != 0) == [1, 3, 5, 7, 9]
  assert filter_array([2, 4, 6, 8, 10], lambda x: x % 2 == 0) == [2, 4, 6, 8, 10]
  assert filter_array([], lambda x: x > 10) == []
output: def filter_array(array, criteria):
   filtered_array = []
   for value in array:
    if criteria(value):
     filtered_array.append(value)
   return filtered_array