我有一个对象数组如下:
var memberships = [
{
id: 1,
type: 'guest'
},
{
id: 2,
type: 'member'
}
];
如何验证这样一个数组是否至少有一个类型为“成员”的元素?
请注意,该数组也可能没有任何元素。