forEach vs $.fn.each

Benchmark created by Cecchi on


Preparation HTML

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>

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

Setup

var $brs = $('br');

Test runner

Ready to run.

Testing in
TestOps/sec
$.fn.each
$brs.each(function() {
    $.noop();
});
ready
forEach
[].forEach.call($brs, function() {
    $.noop();
});
ready

Revisions

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