我有一个像这样的多维JavaScript数组。多个值的Javascript索引
[
["9", "16", "19", "24", "29", "38"],
["9", "15", "19", "24", "29", "38"],
["10", "16", "19", "24", "29", "38"],
["9", "16", "17", "19", "24", "29", "39"],
["10", "16", "17", "19", "24", "29", "39"],
["9", "15", "21", "24", "29", "38"]
.......
.......
]
约40确切
,并具有下列值
[9,10] //This is of size two for example,it may contain any number of elements BUT it only contains elements(digits) from the multidimensional array above
我想是我需要做的多维数组独特的基于对一个又一个阵列称为校验IM检查阵列元素
1.例如检查数组是[15]
那么多维数组将是
[
["9", "15", "19", "24", "29", "38"],
//All the results which contain 15
]
2.Example如果校验序列是[15,21]
然后多维数组将
[
["9", "15", "21", "24", "29", "38"]
//simply containing 15 AND 21.Please note previous example has only 15 in it not 21
//I need an AND not an OR
]
我曾经尝试过的JavaScript的IndexOf方法,但它让我的或运算结果不与
在此先感谢
_“40左右准确”_ - 啊,讽刺。 – nnnnnn 2012-08-09 10:58:06
@nnnnnn ..hope你有想法。如果没有病解释更多 – coolguy 2012-08-09 10:59:36
是的,你想过滤原始数组以返回包含检查数组中所有元素的所有子数组。除了你的第二个例子返回一个没有显示在你的原始数组中的子数组,所以也许我不明白。 (我以前的评论只是在那里选择你喜欢的单词而开心。) – nnnnnn 2012-08-09 11:01:11