You can use indexOf in filter, like this
var res = a.filter(function (el) {
return kpis.indexOf(el.id) >= 0;
});
More Related Contents:
- Filter JSON by key value with JavaScript
- Filter array of objects based on another array in javascript
- How to filter an array from all elements of another array
- javascript filter array multiple conditions
- How to map more than one property from an array of objects
- Filter array of objects with another array of objects
- How to filter an array in javascript?
- How can I only keep items of an array that match a certain condition?
- Filtering array of objects by searching nested object properties
- Recursively filter array of objects
- JavaScript filter array by data from another
- Removing undefined values from Array
- How to use Array.prototype.filter with async?
- Filter nested array in object array by array of values
- Map/Set to maintain unique array of arrays, Javascript
- filter array of objects by another array of objects
- How can I create a two dimensional array in JavaScript?
- Compare JavaScript Array of Objects to Get Min / Max
- How do you put an image file in a json object?
- JavaScript ‘in’ operator for `undefined` elements in Arrays
- javascript surprising array comparison
- How to check whether multiple values exist within an Javascript array
- Converting JSON object to CSV format in JavaScript
- Importing data from multiple csv files in D3
- jQuery UI autocomplete with item and id
- Javascript Set vs. Array performance
- How to search for a string inside an array of strings
- Populate nested object from array?
- What is the concept of Array.map?
- default array values