Responsive Ecommerce Product Page With Lightbox

Solution retrospective
I would love to learn about ways to reduce having so many JavaScript event handlers for all the interactions in this challenge and whether having so many can cause performance issues.
Any additional feedback is also appreciated and welcomed!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @renras
You can look into using event delegation where you put an event listener only to the parent.
Too much event listeners are only bad depending on the function inside it. Most of your functions run in O(n) time or less which is good.
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord