From 95cb4ce15853951281d41fbd81e1cc5d66d273da Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 10 Feb 2022 22:20:06 +0100 Subject: [PATCH] Rename index variables in loops --- src/shareon.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/shareon.js b/src/shareon.js index f8b06fa..4164053 100644 --- a/src/shareon.js +++ b/src/shareon.js @@ -38,14 +38,22 @@ const initializeShareon = () => { const shareonContainers = document.querySelectorAll(".shareon"); // iterate over
- for (let i = 0; i < shareonContainers.length; i += 1) { + for ( + let containerIndex = 0; + containerIndex < shareonContainers.length; + containerIndex += 1 + ) { /** @type Element */ - const container = shareonContainers[i]; + const container = shareonContainers[containerIndex]; // iterate over children of
- for (let j = 0; j < container.children.length; j += 1) { + for ( + let childIndex = 0; + childIndex < container.children.length; + childIndex += 1 + ) { /** @type Element */ - const child = container.children[j]; + const child = container.children[childIndex]; if (child) { const classListLength = child.classList.length;