Dynamic data insertion into a Javascript array
<p>When I set imArray and console.log() it out, the console tells me that each value from members.[i1].friendId is at value 0. I have about 5 values that pass to imArray. This is my first time working with dynamic array looping. So if you could, please explain to me how I'd output this data into an array correctly. </p>

<pre><code>$.getJSON("&lt;?=base_url()?&gt;index.php/regUserDash/chatBoxMembers", function(data) {
    var members = data.chatMembers;
    for(var i1 = 0; i1 &lt; members.length; i1++) {
        var imArray = [members[i1].friendId];
        if(members[i1].activityStatus === 'Minimized') {
            function minimizedBox() {
                return '&lt;span style="position: relative; left: 84px; font-family: Verdana; font-size: 8pt" class="clickForMessageBox"&gt;' + members[i1].firstname + ' ' + members[i1].lastname + '&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
            } $('#box1').append(minimizedBox());
        }
    }
});
</code></pre>
