Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Chrome 96
Windows
Desktop
2 years ago
Test name Executions per second
forEach (Native) 423550.7 Ops/sec
each (jQuery) 314880.8 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(){});