【JavaScript】判断数组对象是否存在某项值
var WorkTypeList = [{ 'WorkTypeId': 1, 'WorkTypeName': '企业主要负责人(A证)' },{ 'WorkTypeId': 2, 'WorkTypeName': '项目负责人(B证)' },
{ 'WorkTypeId': 3, 'WorkTypeName': '专职安全生产管理人员(C证)' }];
var standardWorkType = [];
$.each(WorkTypeList, function (index1, value1) {
if (!<strong>standardWorkType.find(element => element.WorkTypeId ==</strong><strong> value1.WorkTypeId)</strong>) {
standardWorkType.push({ 'WorkTypeId': value1.WorkTypeId, 'WorkTypeName': value1.WorkTypeName });
}
})
搜索
复制
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页:
[1]