Searching Over Multiple Properties
Learn how to extend your generic search function to support searching for multiple object properties simultaneously.
We currently have a genericSearch
function that can filter properties of type string
or number
for any object. However, the disadvantage of this implementation is that it can only search using a single property of an object. An improved generic search would be able to accept one or more properties. For example, if we want to search both the title
and description
of our widgets, our call to genericSearch
might look something like this:
Get hands-on with 1400+ tech skills courses.