Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Chrome 108
Windows
Desktop
2 years ago
Test name Executions per second
forEach (Native) 500439.2 Ops/sec
each (jQuery) 419197.1 Ops/sec
HTML Preparation code:
AخA
 
1
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
2
<link rel="stylesheet" href="style.min.css" type="text/css">
3
<link rel="stylesheet" href="style.min.css" type="text/css">
4
<link rel="stylesheet" href="style.min.css" type="text/css">
5
<link rel="stylesheet" href="style.min.css" type="text/css">
6
<link rel="stylesheet" href="style.min.css" type="text/css">
Tests:
  • forEach (Native)

     
    var linkEls = document.querySelectorAll('link[href*=".min.css"]');
    [].forEach.call(linkEls,function(el){});
  • each (jQuery)

     
    $('link[href*=".min.css"]').each(function(){});