Summation with Currying
In this lesson, we will rewrite our sum function using the currying method.
We'll cover the following
So far, we have been using specific summation functions along with a sum
function to perform summation operations. Is it possible to remove the need for the summation functions and use the sum
function directly?
Currying will help us in doing just that. But for this, we will still need helper functions. For a recap, the helper functions cube
, factorial
, and id
are defined below.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy