Solution#1765
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The gallery implementation correctly uses event delegation on the #thumbs container and the closest('a') method effectively handles both click scenarios—whether clicking directly on an img or on the a element itself. All task requirements are satisfied. One minor suggestion for robustness: consider adding a null check before accessing link.href, since closest('a') returns null if there's no a ancestor. While this won't occur with the current HTML structure, it's a good defensive practice: javascript const link = e.target.closest('a'); if (link) mainImage.src = link.href; Great work on implementing the core functionality correctly!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.