Positive Numbers

Benchmark created on


Description

Check for positive integer

Setup

const target = [123, '123', 0, '0', '1e1000', 'foo', '10px', '', ' ', false, '-12']

Test runner

Ready to run.

Testing in
TestOps/sec
Shift Float
target.map(x => x >>> 0 === parseFloat(x))
ready
ParseInt
target.map(x => +x === parseInt(x))
ready

Revisions

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