这是您应该怎么做的方法:(适用于Google查找)
$([ {"name":"Lenovo Thinkpad 41A4298","website":"google222"}, {"name":"Lenovo Thinkpad 41A2222","website":"google"} ]) .filter(function (i,n){ return n.website==='google'; });
更好的 解决方案:(Salman’s)
$.grep( [{"name":"Lenovo Thinkpad 41A4298","website":"google"},{"name":"Lenovo Thinkpad 41A2222","website":"google"}], function( n, i ) { return n.website==='google';});
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)