I have an array of objects that I want to filter by comparing a nested property to a search term.
For example:
var array = [ {category: \'Bus
You can use array.filter like this:
array.filter
function getFiltered(val) { return array.filter(category == val); }
This function will return a new array instance, only with the category keys you passed as the val params.
category
val