How to re-label Object in array?
<p>Extending a previous question about JavaScript and jQuery, I'm trying to make an array and then look into it, but the array contains dimensions and I can't get it right..</p>

<pre><code>var markers = [];
$.getJSON('GetList', "id"= + data.id,
        function(data){
           $.each(data.list, function(index, data) {
                }
                markers.push( {
                    category:data.category,
                    id:data.id,
                    location:{
                        latitude:data.location.latitude,
                        longitude:data.location.longitude
                    }
                });
            });
        });
        return markers;
}
</code></pre>

<p>The first thing that strikes me is that every item will now be called "Object", while default, I'm still wondering if they can be labeled instead?</p>

<p>Further down the line, I try to access the id to compare it to a selection by the user,
but it doesn't work.</p>

<pre><code>    var selection = $(div_id).val();
    var arr = $.inArray(selection, markersArray.id);
    if( arr &gt;= 0) {
        return search(selection, div_id);
    } else {
        throw("selection not found in selectionSearch()");
    }
</code></pre>

<p>What am I doing wrong here..?</p>
