I have on one occasion found it useful to assign properties to functions before passing them as arguments to other functions.
That looked like this (sorry about any confu
Another way of doing this would be with a helper function:
const addProp = (fn, value) => { fn.process = value; return fn; };
const myFunc = addProp((arg1, arg2) => arg1 + arg2, true);
console.log(myFunc.process); // => true
console.log(myFunc(1, 2)); // => 3
You could probably also do this with a decorator, although that's a proposal for future versions of ECMASCript and would require transpilation to work.