Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
Chrome 68
Mac OS X 10.13.6
Desktop
6 years ago
Test name Executions per second
Array.prototype.filter 907081.1 Ops/sec
for loop & Array.prototype.push 334836.5 Ops/sec
_.filter with function 630489.7 Ops/sec
_.filter with array predicate 1174670.8 Ops/sec
_.filter with object predicate 1118279.1 Ops/sec
_.remove with function 667309.9 Ops/sec
_.remove with array predicate 1161254.1 Ops/sec
_.remove with object predicate 1208059.5 Ops/sec
Array.prototype.forEach & Array.prototype.push 811925.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Array.prototype.filter

  • for loop & Array.prototype.push

  • _.filter with function

  • _.filter with array predicate

  • _.filter with object predicate

  • _.remove with function

  • _.remove with array predicate

  • _.remove with object predicate

  • Array.prototype.forEach & Array.prototype.push


;