Math.floor() vs parseInt()

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor(number)
Math.floor(12 / 9)
ready
parseInt(number)
parseInt(12 / 9)
ready
parseInt(number, radix)
parseInt(12 / 9, 10)
ready
parseInt(string, radix)
parseInt('1.3', 10)
ready

Revisions

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