Rename index variables in loops
parent
51a7597235
commit
95cb4ce158
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue