public void foreach_element (ArrayForeach func)
Iterates over all elements of an array, and calls a function on each one of them.
It is safe to change the value of an element of the array while iterating over it, but it is not safe to add or remove elements from the array.
a JSON array
the function to be called on each element
data to be passed to the function