Znajdź obiekt w tablicy JavaScript z właściwością
let obj = objArray.find(obj => obj.id == 3);
Repulsive Rhinoceros
let obj = objArray.find(obj => obj.id == 3);
const fruits = ['apple', 'banana', 'grapes', 'mango', 'orange'];
const filterItems = (needle, heystack) => {
let query = needle.toLowerCase();
return heystack.filter(item => item.toLowerCase().indexOf(query) >= 0);
}
console.log(filterItems('ap', fruits)); // ['apple', 'grapes']
console.log(filterItems('ang', fruits)); // ['mango', 'orange']