I have an array of arrays , and I need to filter by position 0 of the elements.
I need to filter multiple values extracted from another array, so OR operator is not my way because the amount of values I have is not fixed.
var arr = [
["202",27,44],
["202",194,35],
["200",233,344],
["190",333,444],
];
var newArr = arr.filter(function(item){
//fixed amount of values, not working for my purpose
return item[0] === "190" || item = "200"
});
I need something like
var newArr = arr.filter(function(item){
return item[0] === filterValues
//where filterValues = ["190","200",etc]
});
function in this case should return :
[["200",233,344],["190",333,444]]
This question uses underscorejs but im new to javascript so it was hard to me to apply it to my problem.
And this is for Angularjs.
I hope you can give me a hand.
P.S : Sorry about my english, its not my native language.
regards