javascript splicing array
<p>I have an array of object and I'm looking to remove an element. However, the splice method seems to return the element removed, not the array without the element I wanted to remove.</p>

<p>This is what I have</p>

<pre><code>var TheArray = TheObject.Array;
TheArray = TheArray.splice(TheIndex, 1); //TheIndex is the index of the element I want to remove
TheObject.Array = TheArrray;
</code></pre>

<p>When I debug and run this code, TheObject.Array contains the element I wanted to remove.</p>

<p>What am I doing wrong? Thanks for your suggestions.</p>
