I have a Multi-Dimension Array filled with products. I'm trying to filter my products by passing a bunch of values and then put the resulting products into a new array. Here's what i'm trying to accomplish:
products = [['A','2','F','123'],['A','2','G','234'],['B','2','K','231']];
related = [];
filter1 = 'A';
filter2 = '2';
filter3 = 'G';
for(var i = 0; i < products.length; i++) {
var product = products[i];
for(var j = 0; j < product.length; j++) {
if(filter1=product[0]){
related.push([product[0],product[1]....]);
}
}
}
Then from there, filter the resulting set with filter2 and so on and so forth. Can't seem to figure this out. Any help is greatly appreciated!