max_fruit,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</script>
</head>
<body>
<script>
var data = {
response: {
items: [{
from_id: 111111,
message: 'Hello world'
}, {
from_id: 111111,
message: 'Hello world'
}, {
from_id: 111112,
message: 'Lorem ipsum'
}, ],
profiles: [{
id: 111111,
first_name: {
eng: 'Ivan',
rus: 'Иван'
}
}, {
id: 111112,
first_name: {
eng: 'Stepan',
rus: 'Степан'
}
}]
}
}
var first_name = data.response.profiles.reduce(function(obj, el) {
obj[el.id] = el['first_name']['rus'];
return obj
}, {}),
mes = data.response.items.filter(function(el) {
var id = el['from_id'];
return first_name[id] != 'Степан'
}).map(function(el) {
var id = el['from_id'];
return first_name[id] + ' написал: ' + el.message
})
document.write(mes.join('<br>'))
</script>
</body>
</html>