Using array.splice inside Array prototype
<pre><code>Array.prototype.move = function(oldIndex, newIndex) {
    var val = this.splice(oldIndex, 1);
    this.splice(newIndex, 0, val[0]);
}

//Testing - Change array position
var testarray = [1, 2, 3, 4];
testarray.move(3, 0);
console.log(testarray);
</code></pre>

<p>This produces an error "this.splice is not a function" yet it returns the desired results. Why?</p>
