JavaScript - Store multiple objects in array and access their properties via
<p>So here I have a database of user objects and I would like to push each one into the 'allUsers' array. I then want to be able to loop through this array and access a property e.g. <code>allUsers[i].genrePref</code>. How do I push all of these variables into the array to store them like <code>[user, jon, lucy, mike, luke...</code> </p>

<pre><code>    // Users
    var user = {username: user9110252username, genrePref: user9110252genre};
    var jon = {username: 'Jon', genrePref: 'rock'};
    var lucy = {username: 'Lucy', genrePref: 'pop'};
    var mike = {username: 'Mike', genrePref: 'rock'};
    var luke = {username: 'Luke', genrePref: 'house'};
    var james = {username: 'James', genrePref: 'house'};
    var dave = {username: 'Dave', genrePref: 'bass'};
    var sarah = {username: 'Sarah', genrePref: 'country'};
    var natalie = {username: 'Natalie', genrePref: 'bass'};


    // Users array
    var allUsers = [];
</code></pre>