JSON数组对象某个属性值查找
1、引用国外开源Linq写法的js框架
地址:https://archive.codeplex.com/?p=jslinq
https://www.nuget.org/packages/jslinq
说明实例:https://www.cnblogs.com/landeanfen/p/4672542.html
<script src="js/linq.js"></script> <script type="text/javascript" > var packJson = [ {"name":"zhang", "password":"123"}, {"name":"li", "password":"456"} ]; var name="li"; var de=Enumerable.From(packJson).Where("x=>x.name=='"+name+"'").ToArray(); if(de!=null && de[0]!=null){ console.log(de[0].password); } </script>
作者:江宁织造
博客:http://www.cnblogs.com/wgx0428/
博客:http://www.cnblogs.com/wgx0428/