Design comparison
Solution retrospective
My very first solution on frontendmentor from a couple of months ago. After almost giving up because of the JavaScript, I got "inspired" by someone who's already completed this challenge before me... Otherwise I couldn't have done it. I don't understand the use case of 'this' in line 16. I rewrote a bit of the CSS as I got better doing challenges that didn't need much JavaScript or none at all.
I couldn't figure out a structure how to approach this problem. If there's anything I feel unsure of, it's JavaScript.
Community feedback
- @DavidMorgadePosted over 2 years ago
Hello Barney, congrats on finishing the challenge! don't give up with Javascript, you will start undestanding it with time and practice, trust me!
To answer the question, when you are using an
addEventListener
thethis
keyword targets the button element on the [i] index of your for loop. Thethis
keyword is a large topic that can't get explained on a single feedback comment, but I suggest you to take a look at this article that maybe get things more clear on your mind.I recommend you to start your Javascript journey, don't get frustrated, Javascript is not a hard programming language to learn but has his owns peculiarities, when I started Javascript I felt overwhelmed and got no idea of what I was doing, the time and the practice will help you to get better at it, don't give up!
Hope my feedback helped you!
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin 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