Interactive online courses HTML Academy
2026-03-09 10:54 Diff

The closures really helped us out. The gallery is close to working as intended!

Each time we pass various values to addThumbnailClickHandler. Each handler gets its own closure, in which there are some specific parameter values thumbnail and photo. These are the values that each handler uses when an event occurs. And currently the index value in the already run loop has no effect on our program.

All that we have to do is replace the console output with the src for the large image and make sure that the code works correctly.