theUsers = [
{id: 1, username: 'john'}
{id: 2, username: 'lexy'}
{id: 3, username: 'pete'}
]
To retain only users whose id is greather than 2, use the following:
[{id: 3, username: 'pete'}]
.filter
filteredUsers = theUsers.filter (user) -> user.id >= 2
filteredUsers = (user for user in theUsers when user.id >= 2)