So I’ve been trying to understand the use for closures in Go, but I found this example while helping a friend with JavaScript.
Is this a closure? It seems to meet the requirements, and this use case makes sense for a closure.
let trashImage = document.createElement("img");
trashImage.src = "img/ic_delete_1x.png"; // path of the image
trashImage.addEventListener("click", function () { <--- This addEventListener function
deleteCard(email);
});
Thank you kindly