f The function to use
xs The array
acc The initial value for folding.
Applies a function across an array. For example, given a function sum which adds two integers:
This prints the sum of the values in the array
The following example uses fold to calculate the final direction.
Signing in to our system allows you to post your contributions and vote on the contributions of others. It will also allow you to get extra perts like having your favorites in the cloud and having your persistent personal notes wherever you go. More will be added as we scale up our services.
By signing in to our system, you agree our Member Terms and Conditions
Sign-in with one of the following services
Please select a screen name for NET SOUP.