title: Why using for is faster than some() or filter()
body: <p>I tried two different way to do something and I am surprised by the performance result :</p>
  
  <p>I have 2 versions of a function :</p>
  
  <p>Using a <code>for</code> :</p>
  
  <pre><code>$scope.hasBlockResult = function (IS, area, block) {
      if (!block)
          return false;
      for (var i = 0; i &lt; $scope.filteredCartoList.length; i++) {
          if ($scope.filteredCartoList[i].informationSystem === IS 
              &amp;&amp; $scope.filteredCartoList[i].area === area 
              &amp;&amp; $scope.filteredCartoList[i].block === block)
              return true;
      }
      return false;
  };
  </code></pre>
  
  <p>And using <code>some()</code> function :</p>
  
  <pre><code>$scope.hasBlockResult = function (IS, area, block) {
      if (!block)
          return false;
  
      return ($scope.filteredCartoList.some(function (carto) {
          if (carto.informationSystem === IS &amp;&amp; carto.area === area &amp;&amp; carto.block === block)
              return true;
          return false;
      }));
  };
  </code></pre>
  
  <p>Same thing here :</p>
  
  <p>Between the <code>for</code> :</p>
  
  <pre><code>for (var i = 0; i &lt; $scope.filteredCartoList.length; i++) {
      if ($scope.filteredCartoList[i].informationSystem == IS 
          &amp;&amp; $scope.filteredCartoList[i].type != 'AM' 
          &amp;&amp; $scope.filteredCartoList[i].type != 'IF' 
          &amp;&amp; $scope.filteredCartoList[i].area == area 
          &amp;&amp; $scope.filteredCartoList[i].block == block)
          $scope.resultList.push($scope.filteredCartoList[i]);
      }
  </code></pre>
  
  <p>and the <code>filter()</code> :</p>
  
  <pre><code>$scope.resultList = $scope.filteredCartoList.filter(function (carto) {
      if (carto.informationSystem == IS 
          &amp;&amp; carto.type != 'AM' 
          &amp;&amp; carto.type != 'IF' 
          &amp;&amp; carto.area == area 
          &amp;&amp; carto.block == block)
          return true;
      return false;
  });
  </code></pre>
  
  <p>I expected the <code>filter()</code> and the <code>some()</code> methods to be faster than the <code>for</code> method, but in both case, according to angularjs batarang performance tab, the <code>for</code>is faster.</p>