Is there a name convention if it es 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?
Is there a name convention if it es 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?
Share Improve this question asked Oct 27, 2019 at 19:01 MarcinMarcin 6008 silver badges23 bronze badges2 Answers
Reset to default 9You 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.