title: How to add check in array based on some conditions around a particular element?
body: <p>I have an array named var_name</p>
  <p>How to check in an array if there is an element other than detected</p>
  <p>but if my array does not contain detected</p>
  <p>and contains different element, it shouldn't do anything. For instance:</p>
  <ol>
  <li><code>var_name = [detected, nondetected]</code> it should execute <code>&lt;div&gt; Do something &lt;/div&gt;</code></li>
  <li><code>var_name = [nondetected, inprogress]</code> it should execute <code>&lt;div&gt; Do nothing &lt;/div&gt;</code></li>
  <li><code>var_name = [detected, detected]</code> it should execute <code>&lt;div&gt; Do nothing &lt;/div&gt;</code></li>
  </ol>
  <p>Things tried so far:</p>
  <pre><code>!var_name.includes('detected') ? (&lt;div&gt;Do something&lt;/div&gt;) : (&lt;div&gt;Do nothing&lt;/div&gt;) 
  </code></pre>
  <p>but it fails for my usecase</p>
  <p>So in order to do something, there needs to be at-most 1 instance of detected followed by other elements (like nondetected, etc). If it contains all detected, then still it doesn't do anything. How to execute such that?</p>