code refactoring
better naming of temporary variable for forEach loop
This commit is contained in:
parent
d290bd7db0
commit
4891aca2f8
|
@ -33,10 +33,10 @@ const baxterHeadPat = () => {
|
|||
const main = () => {
|
||||
const tiles = document.querySelectorAll(".tile");
|
||||
|
||||
tiles.forEach((el) => {
|
||||
el.style.cursor = "pointer";
|
||||
el.addEventListener("click", () => {
|
||||
displayNote(el);
|
||||
tiles.forEach((tile) => {
|
||||
tile.style.cursor = "pointer";
|
||||
tile.addEventListener("click", () => {
|
||||
displayNote(tile);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue