$.inArray, _.indexOf, lodash.indexOf, a simple loop, and Array#indexOf (v45)

Revision 45 of this benchmark created on


Description

Added a simpler for loop test

Setup

var arr = [];
for(var i =0; i<10000;i++) arr.push((Math.random()).toString(36));
arr.push('findMe');

Test runner

Ready to run.

Testing in
TestOps/sec
indexOf
arr.indexOf('findMe') > -1
ready
includes
arr.includes('findMe') === true
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.