Сообщение от tk.stas
|
надо чтоб искало по всем
|
<script>
var people = [
{ "name": "bob", "dinner": "pizza" },
{ "name": "john", "dinner": "sushi" },
{ "name": "john", "dinner": "hummus" }
];
var str = "sushi";
var obj = people.filter(function (person) { return Object.values(person).some(function(val) {
return val.toUpperCase() == str.toUpperCase()
})});
document.write(JSON.stringify(obj, null, 4))
</script>