Check if JavaScript array of objects contains

if (users.some(u => u.name === 'b')) {
    // ...
}