Test name | Executions per second |
---|---|
forEach (Native) | 2302.6 Ops/sec |
for (Native) | 2242.4 Ops/sec |
each (jQuery) | 2264.7 Ops/sec |
For of (ES6) | 2332.8 Ops/sec |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<link rel="stylesheet" href="style.min.css" type="text/css">
<link rel="stylesheet" href="style.min.css" type="text/css">
<link rel="stylesheet" href="style.min.css" type="text/css">
<link rel="stylesheet" href="style.min.css" type="text/css">
<link rel="stylesheet" href="style.min.css" type="text/css">
var linkEls = document.querySelectorAll('link[href*=".min.css"]');
[].forEach.call(linkEls,function(el){
console.log(el);
});
var linkEls = document.querySelectorAll('link[href*=".min.css"]');
for(var i = 0; i < linkEls.length; i++) {
var el = linkEls[i];
console.log(el);
}
$('link[href*=".min.css"]').each(function(){
console.log(this);
});
let linkEls = document.querySelectorAll('link[href*=".min.css"]');
for (var el of linkEls) {
console.log(el);
}