Number() vs parseInt() vs plus (v12)

Revision 12 of this benchmark created on


Preparation HTML

<script>
  var i = '10000';
  i += 'b';
  i = i.slice(0, i.length - 1);
  assert(i === '10000');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Number Constructor
Number(i)
ready
parseInt
parseInt(i,10)
ready
Plus operator
+i
ready

Revisions

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