const arr = [
{
name: "zhao",
age: 18,
gender: "male",
status: "teacher",
income: "1000",
},
{
name: "zhao",
age: 20,
gender: "female",
status: "banker",
income: "2000",
},
{
name: "zhao",
age: 20,
gender: "male",
status: "teacher",
income: "3000",
},
......
];
以上面的数组为例,想实现对该数组进行任意单一条件或组合条件查询, 条件是数组中对象的属性名。如我想查询name =zhao, 可得到3条数据,若想再加一个age=20,就可以得到第二条数据,再加一个条件gender=female,就得到第三条.