indexOf vs includes

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
indexOf
x = 'abc'
y = 'c'

z = x.indexOf(y) !== -1
ready
includes
x = 'abc'
y = 'c'

z = x.includes(y)
ready

Revisions

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