Move an array element from one array position to another
<p>I'm having a hard time figuring out how to move an array element. For example, given the following:</p>

<pre><code>var arr = [ 'a', 'b', 'c', 'd', 'e'];
</code></pre>

<p>How can I write a function to move <code>'d'</code> before <code>'b'</code>?</p>

<p>Or <code>'a'</code> after <code>'c'</code>?</p>

<p>After the move, the indices of the rest of the elements should be updated. This means in the first example after the move arr[0] would = 'a', arr[1] = 'd' arr[2] = 'b', arr[3] = 'c', arr[4] = 'e'</p>

<p>This seems like it should be pretty simple, but I can't wrap my head around it.</p>
