1.定义数据 List<Map>
2.js object List<Map> 的自带的api filter(function (e) { return 过滤逻辑})
var menu_data =[
{
"username": "test.cn.01",
"password": "12345",
"product": "ss"
},
{
"username": "test.cn.01",
"password": "12345",
"product": "hf"
},
{
"username": "test.cn.01",
"password": "12345",
"product": "tb"
}
]
var menu_node1 = menu_data.filter(function (e) { return e.product == "hf"; });
console.log(menu_node1);
JS filter 用法之 过滤数据
最新推荐文章于 2024-09-19 00:44:36 发布