Is it possible to search an array for a string of text, then return the contents of the objects which contain it?
For example:
<script>
var itemsArray = ["2Bedroom Ensuite 2Bathroom", "1Bedroom Ensuite 1Bathroom", "3Bedroom 2Bathroom"];
var searchTerm = 'ensuite';
var results = $.searchThing('itemsArray', searchTerm);
document.write(results);
</script>
The above hypothetical script (where 'searchThing' is the method - if it exists) should write
2Bedroom Ensuite 2Bathroom
2Bedroom Ensuite 2Bathroom
Does this exist? How can it be done?
Thanks