this.employee = [ { 名称:" A", 经验丰富:真实; }, { 名称:" B", 经验丰富:真实; }, { 名称:" C", 经验丰富:虚假; },
//这里我需要真值的计数
答案 0 :(得分:0)
尝试:
const experienced = this.employee.reduce((acc, e) => e.isexperienced ? acc+1 : acc, 0);
其次,您的员工数组不正确:
;
,true
false
]