jQuery.isNumeric

Benchmark created on


Preparation HTML

<script src="//code.jquery.com/jquery-1.7.js"></script>

Setup

rdigit = /\d/;
    
    jQuery.isNumeric2 = function( obj ) {
        return obj !== null && rdigit.test( obj ) && !isNaN( obj );
    };

Test runner

Ready to run.

Testing in
TestOps/sec
before
jQuery.isNumeric(NaN);
ready
after
jQuery.isNumeric2(NaN);
ready

Revisions

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