string to number conversion

Benchmark created by Nao Iizuka on


Test runner

Ready to run.

Testing in
TestOps/sec
parseInt
var num = parseInt("123", 10);
ready
Math.floor
var num = Math.floor("123");
ready
plus sign
var num = +"123";
ready
Number constructor
var num = Number("123");
ready
minus zero
var num = "123" - 0;
 
ready
multiply by one
var num = "123" * 1;
 
ready
divide by one
var num = "123" / 1;
 
ready

Revisions

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

  • Revision 1: published by Nao Iizuka on