Delete row from Object
<p>I have an object containing an array:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    var statusData = {
        Status: []
    };

    var uniqueCounter = 1

    function createJsonFmtData() {      

        // Used as unique id at client side 
        var uniqueCounter =uniqueCounter + 1;

        statusData.Status.push({
            "Name": Name,
            "Time": Time,
            "Email": Mail,
            "Name": Type,
            "Value": Value,
            "uniqueId": uniqueCounter
        });
    }

    function DelNewlyCreStatusRow(rowId) {
        // First pop elment from json data
        var val;
        for (val = 0; val &lt; statusData.Status.length; ++val) {
            if (statusData.Status[val].uniqueId == rowId) {
                delete statusData.Status[val];
                break;
            }
        }
&lt;/script&gt;
</code></pre>

<p>When try to call <code>DelNewlyCreStatusRow</code> it gives the error:</p>

<blockquote>
  <p>TypeError: statusData.Status[val] is undefined</p>
</blockquote>

<p>I am not able to figure it out here where as I have declared it as global.</p>
