Split first element

Benchmark created on


Setup

const str = '1234:5678';

Test runner

Ready to run.

Testing in
TestOps/sec
Split
str.split(':')[0]
ready
.indexOf + .substring
const index = str.indexOf(':');
str.substring(0, index)
ready

Revisions

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