Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Firefox 62
Windows 7
Desktop
6 years ago
Test name Executions per second
SMALL Array.includes(myValue) 34895268.0 Ops/sec
SMALL myValue in Array 112797000.0 Ops/sec
LARGE BEGINNING - Array.includes(myValue) 30879354.0 Ops/sec
LARGE BEGINNING - myValue in Array 115310504.0 Ops/sec
LARGE END- Array.includes(myValue) 106817.5 Ops/sec
LARGE END- myValue in Array 114861120.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • [].includes small

  • [].includes large beginning

  • [].ncludes large end

  • _.includes large end

  • indexOf smallArray

  • indexOf largeArray beginning

  • indexOf largeArray end


;