This function "walks" through an array, applying a user-defined function to every element. It returns the changed array.