title: Can't break out of some() array method
body: <p>I got a click event attached to a button to perform a search that checks if a certain element matches a certain condition. In the snippet below there is a some() array method that checks the 'entriesFound' array for the element that matches a certain condition. However everything works find till the else if(el.name !== name.value) condition. The alertbox shows but I need to click the OK button in the alertbox as many times as there are elements in the entriesFound array.</p>
  <pre><code>import { persons } from './main.js';
  
  export let entriesFound = []
  
  export const searchBtn = document.querySelector('.search').addEventListener('click' , function() {
       let name = document.querySelector('.searchInput')
  
          if(name.value === &quot;&quot;) {
              alert('No search query!')
              return;
          }
  
          entriesFound.some( el =&gt; {
              if(el.name === name.value){
                  name.value = &quot;&quot;
                  alert(&quot;You\'ve already found what you are looking for!&quot;)
                  el.remove();
  
              // from here things go wrong
  
              }else if(el.name !== name.value){
                  alert(&quot;No data found!&quot;)
                  return;
              }
          })
  
          persons.some( el =&gt; {
              if(el.name === name.value) {
                  addItem(el)
                  entriesFound.push(el);
              }
          })
      name.value = &quot;&quot;
      localStorage.setItem('entriesFound', JSON.stringify(entriesFound))
  }) 
  </code></pre>