filter two things

I've got an array and I'm using filter() on it to get a new array. I'm comparing it from a value from input with the name property in the array. but I want it to use another value too to check if it includes that from the property tagname, what should I do.
result = data.filter(
card => {
return card.Name.toLowerCase().replace(/ /g, '').includes(inputvalue)
})
result = data.filter(
card => {
return card.Name.toLowerCase().replace(/ /g, '').includes(inputvalue)
})
but I want to do something like, this is probably wrong but
return card.Name.toLowerCase().replace(/ /g, '').includes(inputvalue)
card.tagname.toLowerCase().replace(/ /g, '').includes(inputvalue) //This one turns gray and not reachable what could I do here.
return card.Name.toLowerCase().replace(/ /g, '').includes(inputvalue)
card.tagname.toLowerCase().replace(/ /g, '').includes(inputvalue) //This one turns gray and not reachable what could I do here.
1 Reply
Malik
Malik2y ago
tried a solution and it worked
return
card.Name.toLowerCase().replace(/ /g, '').includes(inputvalue)||card.tagname.toLowerCase().replace(/ /g, '').includes(inputvalue)
return
card.Name.toLowerCase().replace(/ /g, '').includes(inputvalue)||card.tagname.toLowerCase().replace(/ /g, '').includes(inputvalue)
Want results from more Discord servers?
Add your server