Best practice switching place of two items in an array
<p>What is best practice for switching two items place in an Array via JavaScript?</p>

<p>For example if we have this array <code>['one', 'two', 'three', 'four', 'five', 'six']</code> and want to replace two with five to get this final result: <code>['one', 'five', 'three', 'four', 'two', 'six']</code>.</p>

<p><img src="http://i.stack.imgur.com/CK1DO.png" alt="enter image description here"></p>

<p>The ideal solution is short and efficient. </p>

<p>Update:</p>

<p>The <code>var temp</code> trick is working and I know it. My question is: is using <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array#Methods" rel="nofollow">JavaScript native Array methods</a> faster or not? </p>

<p>Something like <code>array.splice().concat().blah().blah()</code> seems is faster and use less memory. I didn't develope a function that using Array methods but I'm sure it's possible.</p>
