Checking vs not checking

Benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<input type="button" id="btn" />

Test runner

Ready to run.

Testing in
TestOps/sec
Checking
if ($("#btn").is(":disabled")){
    return;
}

$("#btn").attr("disabled", !$("#btn").is(":disabled"));
ready
Not Checking
$("#btn").attr("disabled", true); 
ready

Revisions

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