Pardon my complete lack of javascript knowledge in advance, but I can\'t seem to find a good example of how to compare two arrays and create another array based the results.
Use indexOf
to find if the user exists in your array.
var goodUsers = ["someuser1", "someuser2", "someuser3"];
var storedUsers = ["someuser1", "user", "user3"];
for(var goodUser in goodUsers){
if(storedUsers.indexOf(goodUsers[goodUser])>-1){
console.log('User:' + goodUsers[goodUser] + ' is good.')
}
}