[Regexp] multiple match vs test

Benchmark created on


Setup


Test runner

Ready to run.

Testing in
TestOps/sec
match
return !!(navigator.userAgent.match(/Android/i)
      || navigator.userAgent.match(/webOS/i)
      || navigator.userAgent.match(/iPhone/i)
      || navigator.userAgent.match(/iPad/i)
      || navigator.userAgent.match(/iPod/i)
      || navigator.userAgent.match(/BlackBerry/i)
      || navigator.userAgent.match(/Windows Phone/i));
ready
test
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent);
ready

Revisions

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