My filter function here works great, however it only filters the first name (see code). So I was wondering what the "best" way to make it filter by surname and phone too (see image)! Here's my filter at the moment:
const filteredUsers = this.state.dataToDisplay.filter(item => {
return (
/*Only firstname!*/item.name.toLowerCase().indexOf(this.state.search.toLowerCase()) >= 0
)
})
Thanks a lot! :D
