过滤多维数组jquery
我有一个插件(https://github.com/bjorn2404/jQuery-Store-Locator-Plugin)使用以下代码创建多维数组: locationset[i] = new Array (distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3); i++; locationset[i]=新数组(距离、名称、纬度、液化天然气、地址、地址2、城市、州、邮政、电话、网络、小时1、小时2、小时3); i++; 我需要根据距离对其进行过滤(假设它应该小于10) 有办法做到这一点吗 谢谢过滤多维数组jquery,jquery,arrays,filter,Jquery,Arrays,Filter,我有一个插件(https://github.com/bjorn2404/jQuery-Store-Locator-Plugin)使用以下代码创建多维数组: locationset[i] = new Array (distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3); i++; locationset[i]=新数组(距离、名称、纬度、液化天然气、地址
var filtered_数组=$.grep(位置集,函数(值){
var filtered_array = $.grep(locationset, function(value) {
return value[0] < 10;
});
返回值[0]<10;
});
你应该使用,因为这就是它的设计目的 使用