Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36
Chrome 74
Windows
Desktop
5 years ago
Test name Executions per second
Array.prototype.filter 503486.5 Ops/sec
for loop & Array.prototype.push 263652.2 Ops/sec
_.filter with function 345991.0 Ops/sec
_.filter with array predicate 654159.6 Ops/sec
_.filter with object predicate 610898.3 Ops/sec
_.remove with function 295815.8 Ops/sec
_.remove with array predicate 628011.3 Ops/sec
_.remove with object predicate 695655.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


;