why doesn't this grep() work?
I've included some js below. Grep examples 1 and 2 work. Grep example 3 does not work. Any idea why grep example 3 does not work?
=======
<script src="jquery-3.0.0.min.js"></script>
<script>
$(function(){
var users =
[{
FirstName: 'John',
LastName: 'Smith'
},
{
FirstName: 'David',
LastName: 'Johnson'
},
{
FirstName: 'Bill',
LastName: 'Jones'
}];
var filteredUsers =
$.grep(users, function(user, i){
//1. works
//return user.LastName == 'Smith';
//2. works
//return user.LastName != 'Smith';
//3. does not work
return
user.LastName != 'Smith' &&
user.LastName != 'Johnson';
});
});
</script>