Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
过滤多维数组jquery_Jquery_Arrays_Filter - Fatal编程技术网

过滤多维数组jquery

过滤多维数组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]=新数组(距离、名称、纬度、液化天然气、地址

我有一个插件(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)

有办法做到这一点吗

谢谢

var filtered_数组=$.grep(位置集,函数(值){
var filtered_array = $.grep(locationset, function(value) { 
    return value[0] < 10;
});
返回值[0]<10; });
你应该使用,因为这就是它的设计目的

使用