diff --git a/js/anchorlinks.js b/js/anchorlinks.js index 9a7655848a..088a0a1e49 100644 --- a/js/anchorlinks.js +++ b/js/anchorlinks.js @@ -1,12 +1,8 @@ -(function(d) { - "use strict"; - var hs = d.querySelectorAll("H1, H2, H3"), h; - - for (var i = 0; i < hs.length; i++) { - h = hs[i]; - if (h.id != null && h.id.length > 0) { - h.insertAdjacentHTML('beforeend', '🔗') - } - } - +(function (d) { + "use strict"; + for (const h of d.querySelectorAll("H1, H2, H3")) { + if (h.id != null && h.id.length > 0) { + h.insertAdjacentHTML('beforeend', `🔗`) + } + } })(document);