HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
var array = new Array(10000).fill().map((v, i) => i);
Tests:
  • lodash filter then includes method

     
    var result = _.chain(array).map((v) => v + 1)
      .filter((v) => v % 3 === 0)
      .slice(0, 10).value();
  • es6 filter then includes method

     
    var result = array.map((v) => v + 1)
      .filter((v) => v % 3 === 0)
      .slice(0, 10);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    lodash filter then includes method
    es6 filter then includes method

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36
Chrome 94 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
lodash filter then includes method 620088.4 Ops/sec
es6 filter then includes method 3369.2 Ops/sec