For those who want to filter from an array of objects using any key:
function filterItems(items, searchVal) {_x000D_
return items.filter((item) => Object.values(item).includes(searchVal));_x000D_
}_x000D_
let data = [_x000D_
{ "name": "apple", "type": "fruit", "id": 123234 },_x000D_
{ "name": "cat", "type": "animal", "id": 98989 },_x000D_
{ "name": "something", "type": "other", "id": 656565 }]_x000D_
_x000D_
_x000D_
console.log("Filtered by name: ", filterItems(data, "apple"));_x000D_
console.log("Filtered by type: ", filterItems(data, "animal"));_x000D_
console.log("Filtered by id: ", filterItems(data, 656565));
_x000D_
filter from an array of the JSON objects:**