Repository navigation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that the logic for choosing a random quote and updating the
quoteandauthorelements appears twice: once in theDOMContentLoadedhandler and once in the button click handler. If you ever need to change how a quote is picked or how it is displayed (for example, changing the DOM element IDs or adding extra formatting), you would need to remember to update both places and keep them in sync.How would it feel to extract those three lines into a small function, and then call that function from both event listeners? That way the behavior for “show a new quote” would live in exactly one place, and both the initial load and the button click would just reuse it. This can make the code easier to maintain and test as the project grows.
To "like" or "dislike" this comment, please follow this link