I have simply object:
var page = [
{
title: 'aaa',
text: '111'
},
{
title: 'bbb',
text: '222'
},
{
title: 'ccc',
text: '333'
},
{
title: 'ddd',
text: '444'
},
];
Data are examples.
And i have string:
var to_get = '222, 444';
There are texts separated by commas. How can i get Title for this text?
For this example i would receive:
var to_return = 'bbb, ddd';
Separated by commas.
I try use $.each and $.inArray but i dont know how to combine this for multi array.