jQuery size() vs length

Benchmark created by Frank Parent on


Preparation HTML

<ul>
    <li>Apple</li>
    <li>Orange</li>
    <li>Mango</li>
    <li>Blueberry</li>
    <li>Watermelon</li>
</ul>

Test runner

Ready to run.

Testing in
TestOps/sec
size()
var size1 = $("li").size();
ready
length
var size2 = $("li").length;
ready

Revisions

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