Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36
Chrome 86
Mac OS X 10.15.7
Desktop
4 years ago
Test name Executions per second
_.filter 3604146.8 Ops/sec
array filter 1355199.4 Ops/sec
HTML Preparation code:
AخA
 
1
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.core.js"></script>
Script Preparation code:
 
var numbers = [10, 40, 230, 15, 18, 51, 1221]       
Tests:
  • _.filter

     
    _.filter(numbers, num => num % 3 === 0)
  • array filter

     
    numbers.filter(num => num % 3 === 0)