Extension function for JSONArray to iterate over each element.
JSONArray
A lambda function to be executed for each element in the JSONArray.