title: Removing an item when using Array.prototype.map() in Javascript
body: <p>I currently have a variable that contains an array of numbers</p>
  
  <pre><code>let numbersArray = [12, 15, 19, 20];
  </code></pre>
  
  <p>When looping over it I want to delete the entry if it is a certain value</p>
  
  <pre><code>let numbersArray = [12,15,19,20],
      filteredNumbersArray = numbersArray.map(function(value)
      {
          if(value === 15)
          {
              //delete the value
          } else {
              return value * 2;
          }
      });
  </code></pre>
  
  <p>In regards to using <code>.filter()</code>, the value must be mutatable, I have updated the example</p>
  
  <p>I have searched through <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="noreferrer">MDN</a> but couldn't find anything about removing an element within a <code>map()</code>.</p>
  
  <p><sub>The Rubber Duck didn't help either</sub></p>