Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
Chrome 64
Windows
Other
2025 years ago
Test name Executions per second
indexOf first 10060243.0 Ops/sec
$.inArray first 3328116.5 Ops/sec
indexOf last 898939.0 Ops/sec
$.inArray last 754898.6 Ops/sec
indexOf middle 1537917.9 Ops/sec
$.inArray middle 1214490.8 Ops/sec
indexOf 544342.8 Ops/sec
$.inArray 404531.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;