Skip to content

Commit

Permalink
Prefer for-loops to forEach
Browse files Browse the repository at this point in the history
  • Loading branch information
qsantos committed Oct 14, 2024
1 parent 68980e3 commit 92b5d10
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,18 +965,18 @@ chrome.storage.sync.get((options) => {
}
currentThing = thing;
currentThing.classList.add("activething");
getThingTop10Links(currentThing).forEach((link) =>
link.classList.add("numbered-link"),
);
for (const link of getThingTop10Links(currentThing)) {
link.classList.add("numbered-link");
}
}

function deactivateCurrentThing() {
if (!currentThing) {
return;
}
getThingTop10Links(currentThing).forEach((link) =>
link.classList.remove("numbered-link"),
);
for (const link of getThingTop10Links(currentThing)) {
link.classList.remove("numbered-link");
}
currentThing.classList.remove("activething");
currentThing = undefined;
}
Expand Down

0 comments on commit 92b5d10

Please sign in to comment.