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 an array containing only the elements that satisfy the criteria. If the given array is empty, the function should return an empty array.
  
  ### Function:
  def filter_array(array, criteria):
   # Create an empty list
   filtered_array = []
   # Iterate through the array
   for value in array:
    # Check if it matches the criteria
    if criteria(value):
     # If it matches, add it to the list
     filtered_array.append(value)
  
   # Return the filtered array
   return filtered_array
  
  ### Assertions:
  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([3, 6, 9, 12, 18], lambda x: x % 2 == 0) == [6, 12, 18]
  assert filter_array([], lambda x: x % 3 == 0) == []
  assert filter_array([1, 3, 5, 7, 9], lambda x: x > 10) == []
  assert filter_array([10, 20, 30, 40, 50], lambda x: x >= 30) == [30, 40, 50]
output: def filter_array(array, criteria):
   filtered_array = []
   for value in array:
    if criteria(value):
     filtered_array.append(value)
   return filtered_array