var clickDateArr = [
{date: '1', type: 'current', status: 'submit'},
{date: '2', type: 'current', status: 'pending'},
]
// 判断对象数组中,存不存在状态为submit 的数据,如果存在, isSubmit 为true ,不存在为false
var isSubmit = clickDateArr.some(item => item.status == 'submit');
some 判断对象数组中是否存在一个属性
最新推荐文章于 2023-07-24 11:49:50 发布