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.
The brute force method would be something like this:
var users = []; // here is where you get the users from the device
var goodUsers = []; // here you get your good users list
var badUsers = []; // initialize an empty array for bad users
for (var i=0; i< users.length; i++) {
var isAGoodUser = false;
for(var y=0; y< goodUsers.length; y++) {
if(users[i] == goodUsers[y]) {
printf('Username: ' + users[i] + ' is good\n');
isAGoodUser = true;
break;
}
}
if(!isAGoodUser){
printf('Username: ' + users[i] + ' is NOT good\n');
badUsers.push(users[i]);
}
}