Consider the following example
function doSomethingToAVariable(variable){ return variable + 1 } function doSomethingToAVariableASecondTime(variable){ re
If it's as simple as adding some things together how about a recursive method. A bit like using promises but without actually using them.
function add(x) { return { done: () => x, add: (y) => add(x + y) } } let myVariable = 0; add(myVariable).add(1).add(2).add(3).done(); // 6
DEMO