And this is my JS code and live preview . Only points to highlight in my code comparing to the solved one by chris are:
I used addEventListener instead of using the event handler as property. Being able to remove the listeners was what made me decide for it (even if it didnât matter at this early stage ).
Because of the previous point, I didnât code the displayImage function specified in the guidelines. It was going to be only one line in there, and I was already using event function handlers. Too many functions for something that simple. But, I was able to see that setting up displayImage allow us to used it in a wide different set of events in case we want to improve our gallery; i.e. dragging a file to the page, display such picture and show another thumbnail at the bottom.
I loved this assessment! it was challenging. Iâm going to read again the âIntroduction to eventsâ section as well as the external links in there. I felt like it was a stepped curve of learning.