Rename index variables in loops

pull/45/head
Nikita Karamov 2022-02-10 22:20:06 +01:00
parent 51a7597235
commit 95cb4ce158
No known key found for this signature in database
GPG Key ID: 3C8E688C96EEB9C9
1 changed files with 12 additions and 4 deletions

View File

@ -38,14 +38,22 @@ const initializeShareon = () => {
const shareonContainers = document.querySelectorAll(".shareon");
// iterate over <div class="shareon">
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 <div class="shareon">
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;