naming convention for the first function in curried functions

Viewed 1309

Is there a name convention if it comes to curried function like this:

const someName = argA => argB => ...
const newFunction = someName(someArg)

is there any convention for naming the declaration of someName? like prefixing it with init / create etc?

2 Answers

You could take a descriptive naming, like

const
    multiplyBy = a => b => a * b,
    multiplyWith5 = multiplyBy(5);

var array = [3, 14],
    result = array.map(multiplyWith5);

I like to use a trailing underscore: const curriedFunction_ = () => () => {} this way it indicates something's different.

Related