HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Tests:
  • lodash

    x
     
    const a = [2, 1];
    const b = [2, 3];
    const result = _.intersection(a, b);
  • vanilla js

     
    const a = [2, 1];
    const b = [2, 3];
    const intersection = (arr, ...args) =>
      arr.filter(item => args.every(arr => arr.includes(item)))
    const result = intersection(a, b);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    lodash
    vanilla js

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
lodash 4949399.0 Ops/sec
vanilla js 47151260.0 Ops/sec