\s vs \s+ (v4)

Revision 4 of this benchmark created on


Preparation HTML

<script>
  var str = '  A   B    C D    E   F GH I J    K     L M NOP Q  R   S TUVW XY  Z';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
\s
str.replace(/ /g, '');
ready
\s+
str.replace(/\s+/g, '');
ready

Revisions

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