+str or str >> 0 or ~str

Benchmark created by Leo Dutra on


Preparation HTML

<script>
  var str = '9';
  var str2 = '999';
  var NAN = 1 * 'k';
  var num = 9;
  var num2 = 999;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
+str
+str; + str2; + NAN; + num; + num2;
ready
str >> 0
str >> 0;
str2 >> 0;
NAN >> 0;
num >> 0;
num2 >> 0;
ready
~str
~str;~str2;~NAN;~num;~num2;
ready
+str || 0;
+str || 0; + str2 || 0; + NAN || 0; + num || 0; + num2 || 0;
ready
+num
+num2;
ready
+num || 0
+num2 || 0;
ready
num >> 0
num2 >> 0;
ready

Revisions

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

  • Revision 1: published by Leo Dutra on