I have the following array of objects:
var memberships = [
{
id: 1,
type: 'guest'
},
{
id: 2,
type: 'member'
}
];
How can I verify if such an array has at least one element with type 'member'?
Note that the array can also have no elements.