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. allUsers[i].genrePref
. How do I push all of these variables into the array to store them like [user, jon, lucy, mike, luke...
// 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 = [];