variable change and reset logic
<p>I'm noticing that I'm doing this a lot in my code. </p>

<p>I need to store the value of a variable so I can change it and restore it again. Let's say the variable is <code>var1</code>. I need to use the variable under the same name <code>var1</code> which means I need to make the value changes to it directly. But I don't want to lose the original value. So I store it somewhere <code>var1_original</code>, make the change to it, run the code I need to run, then restore the original value. </p>

<pre><code>  var var1_original = var1;
  var1 = 'new value'; //I have to store the new value under the same name (var1) 

  //have some 
  //lines of code
  //here

  var1 = var1_original;
</code></pre>

<p>So, I need to do this on many variables (var1, color, dimArr, etc.) and of course the code that gets executed in the middle is different. Is there a way to create a function that would do saving and restoring, but still let the code in the middle run?</p>
