- Duplicate Code
- Magic Strings
- Long Function / Mixed Responsibilities
Created an updateUI() function to handle counter updates and color changes reducing amount of longer functions
Defined constants like INCREMENT_ID, RESET_ID, and color variables to improve readability and make changes easier in the future.
Separated the code into two clear phases:
createUI()handles HTML creation.attachEventListeners()connects button logic.