Q:

JavaScript - prevent push of certain element into an array if condition is true

So I have this system that iterates through a group of users and if their genre preference matches mine then they are pushed into an array of potential matches. However I want it so that I can't match with myself (i.e. the user with the same userid, in this case '324') but I want the rest of the matches to be pushed into the array.
var me = {meUserid: 324, meGenre: 'rock'};

var users = {
    user1: {userid: 276, userGenre: 'rock'},
    user2: {userid: 335, userGenre: 'jazz'},
    user3: {userid: 324, userGenre: 'rock'}, //Same userid and genre
    user4: {userid: 603, userGenre: 'rock'},
    user5: {userid: 502, userGenre: 'country'},
};

// Users array
var userProfile = [];

// Populate users array
for(var key in users) {
    userProfile.push(users[key]);
}

var potentialMatches = [];

for(var i = 0; i < userProfile.length; i++){

    // If genre matches that of another user's genre preference, push these compatible users into matches array
    if(userProfile[i].userGenre == me.meGenre){

        potentialMatches.push(userProfile[i]);
    }
}

console.log(potentialMatches);

I know it will be an if statement something along the lines of:
if(meUserid == userProfile[i].userid){
   //Do something
}

but am unsure of what to make the if statement, any ideas?
The result should look something like:
potentialMatches = [{user1: {userid: 276, userGenre: 'rock'}}, {user4: {userid: 603, userGenre: 'rock'}}]

Thanks!

A:

Just add this to if statement
for (var i = 0; i < userProfile.length; i++) {
  if (userProfile[i].userGenre == me.meGenre && userProfile[i].userid != me.meUserid) {
     potentialMatches.push(userProfile[i]);
   }
}

