Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140071

Search an array of words or a string with array of words using includes

$
0
0

I have a string or I can make it an array of strings. and when I try to filter it using includes if there are more than one search terms it doesn't return anything where is my mistake?

villas() {
    return this.$store.state.villas.filter((villa) => {
      return villa.f.includes(this.toFilter)
    });
  }

here is toFilter is the array of search terms and f is the string i make the searching


Viewing all articles
Browse latest Browse all 140071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>