📜  typescript 计数数组条件 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:24.547000             🧑  作者: Mango

代码示例3
let data = [ { "id": 1, "is_read": true, }, { "id": 2, "is_read": true, }, { "id": 3, "is_read": false, }, { "id": 4, "is_read": true, }, ],
length = data.filter(function(item){
  return item.is_read;
}).length;
console.log(length)