const getUsersByKeyValue = (arr, key, value) =>
arr.filter(user => (user = user[key], Array.isArray(user) ? user.includes(value) : user == value));
let arrFilter = getUsersByKeyValue(users, "friends", "Briana Decker");
console.log(arrFilter.map(el => 'Объект '+el.name));
arrFilter = getUsersByKeyValue(users, "eyeColor", "blue");
console.log(arrFilter.map(el => 'Объект '+el.name));
|