How to move/change the position/order of an JavaScript Object array(JSON)?
<p>Let's say I have this javscript object array,</p>

<pre><code>[{a:'a', b:2, c:true}, {a:'b', b:3, c:true}, {a:'a1', b:3, false}]
</code></pre>

<p>Let's say I need to move the object at index 0 to 2. I have tried this function with no luck.</p>

<pre><code>   Array.prototype.move = function (old_index, new_index) {
    if (new_index &gt;= this.length) {
        var k = new_index - this.length;
        while ((k--) + 1) {
            this.push(undefined);
        }
    }
    this.splice(new_index, 0, this.splice(old_index, 1)[0]);
  };
</code></pre>
