Removing table rows (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<table id="sometable">
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
<tr><td>5</td></tr>
</table>

Test runner

Ready to run.

Testing in
TestOps/sec
selector
$("#sometable").find("tr:gt(1):not(:last)").remove();
ready
slice
$("#sometable").find('tr').slice(2,-1).remove()
ready

Revisions

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