How to avoid multiple variable re-declarations on function outputs in JavaScript
<p>Consider the following example</p>

<pre><code>function doSomethingToAVariable(variable){
    return variable + 1
}

function doSomethingToAVariableASecondTime(variable){
    return variable + 2
}

function doSomethingToAVariableLastly(variable){
    return variable + 3
}

var myVariable = 0;
myVariable = doSomethingToAVariable(myVariable);
myVariable = doSomethingToAVariableASecondTime(myVariable);
myVariable = doSomethingToAVariableLastly(myVariable);

console.log(myVariable); // 6
</code></pre>

<p>How do I avoid the nasty myVariable re-declarations? Could wrapping each of the functions into a Promise chain be a solution? </p>