added functionality to a button to toggle between two values.

Solution retrospective
I'm proud of the fact that I took my time on this project. Struggled through the functionality
What challenges did you encounter, and how did you overcome them?I encountered multiple issues, such as trying to make different functions run at different screen sizes. To solve this, I implemented the window.matchMedia() method, which allows JavaScript to dynamically respond to screen size changes, similar to CSS media queries.
Another issue was that my code worked well in Chrome DevTools but refused to work in my main browser window. To fix this, I wrapped my entire script in "DOMContentLoaded" to ensure it runs only after the HTML document has fully loaded. I also specified the screen size precisely.
What specific areas of your project would you like help with?This is my first JavaScript challenge in a long time. My code writing style is amateur. There are probably better ways I could do this so I'm open to all opinions
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Obiwumma's solution.
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