checkifexiststss

Benchmark created by chase on


Preparation HTML

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

Setup

var foo = $("#foo"),
        bar = $("#bar");

Test runner

Ready to run.

Testing in
TestOps/sec
length
if(bar.length) {
}
ready
length>0
if(bar.length > 0) {
}
ready
sub0
if(bar[0]) {
}
ready

Revisions

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