title: Is there a better way to loop through an array of strings like these?
body: <pre><code>if (match !== true) {
      sentences.forEach((sentence) =&gt; {
          for (let i = 0; i &lt; include.length; i++) {
              for (let e = 0; e &lt; exclude.length; e++) {
                  if (
                      sentence.includes(include[i]) &amp;&amp;
                      !sentence.includes(exclude[e])
                  ) {
                      console.log(
                          &quot;Matched the word&quot;,
                          `&quot;${include[i]}&quot;`,
                          &quot;in setence&quot;,
                          `&quot;${sentence}&quot;`
                      );
                      match = true;
                      break;
                  } else {
                      match = false;
                  }
              }
          }
      });
  }
  </code></pre>
  <p>I don't know if there's a better way to loop through the sentences and check if the include keywords are there and the exclude keywords aren't.</p>
  <p>This is the output:</p>
  <pre><code>Matched the word &quot;father&quot; in setence &quot;Man, I am not your father&quot;
  Matched the word &quot;son&quot; in setence &quot;You are my son!&quot;
  No match!
  Loop ended
  </code></pre>
  <p>Does a filter method will worK?</p>