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 a new array containing only the elements that satisfy the criteria. If the array is empty, it 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
  
  result = filter_array([1, 2, 5, 10, 15, 20, 25, 30], lambda x: x % 5 == 0)
  assert result == [5, 10, 15, 20, 25, 30]
  result = filter_array([3, 7, 12, 18], lambda x: x % 5 == 0)
  assert result == []
  result = filter_array([], lambda x: x % 5 == 0)
  assert result == []
output: def filter_array(array, criteria):
   filtered_array = []
   for value in array:
    if criteria(value):
     filtered_array.append(value)
   return filtered_array