title: Break out of map
body: <p>so i have this problem where if the value in the array is higher than entered value it should do something and then stop the loop and don't touch the remaining values in the array.. Here's the code so far:</p>
  
  <pre><code>const percentages = [];
  let enteredValue = parseInt(event.target.value, 10);
  
  range.map((rangeValue, i) =&gt; {
    if (rangeValue &lt;= enteredValue) {
      percentages.push(100);
      enteredValue = enteredValue - rangeValue;
    } else {
      percentages.push(enteredValue * 100 / (rangeValue));
  
      return;
    }
  });
  </code></pre>