Date Archives

July 2020

Infinite Currying Function

We use a simplistic way to create an infinite currying function in JavaScript, with the help of Object.assign and valueOf.Object.assign here will catch all the secondary object properties and set them into the first object. In this example, our primary object is our function. So the valueOf we have marked will return the total of all the prepared arguments provided when called.