map 使用

原创 李仁伟前端笔记 随笔 js 234阅读 2018-06-13 17:57:39 举报

map 遍历
pFind(obj,name) {
let peilv = '';//&&item["playId3"] == ${obj}&&item["number"] == ${name}
this.reteList.map((item, index) => {
if (item["lId"] == '11111'&&item["pId"] == ${obj}&&item["name"] == ${name}) {
peilv = item["mony"];
}
});
return peilv;
},

reteList: [{
"pId": "123",
"lId": "11111",
"name": "小李",
"mony": "1000"
},
{
"pId": "123",
"lId": "11111",
"name": "小王",
"mony": "2100"
}]

        pFind(obj,name) = 2100  ,1000
评论 ( 0 )
最新评论
暂无评论

赶紧努力消灭 0 回复