Parsing

Benchmark created on


Setup

const u = "javascript:test()"
const jsProtocolPrefix = "javascript:"
const jsProtocolRegex = /^javascript:/i

Test runner

Ready to run.

Testing in
TestOps/sec
strings
const value = u.toLowerCase().trim().substring(0, jsProtocolPrefix.length) === jsProtocolPrefix
ready
regex
const value = jsProtocolPrefix.test(u.trim());
ready

Revisions

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