input: Write a function to filter an array based on a given criteria. The function should return an 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
  
  criteria = lambda x: x % 5 == 0
  array = [1, 2, 5, 10, 15, 20, 25, 30]
  assert filter_array(array, criteria) == [5, 10, 15, 20, 25, 30]
output: def filter_array(array, criteria):
   filtered_array = []
   for value in array:
    if criteria(value):
     filtered_array.append(value)
   return filtered_array