Repository navigation
London | No Cohort | Daniel Wagner-Hall | Sprint 3 | Quote Generator - #1477
illicitestonion wants to merge 3 commits into
Conversation
| const showNewQuote = () => { | ||
| const {quote, author} = pickFromArray(quotes); | ||
| document.getElementById("quote").innerText = quote; | ||
| document.getElementById("author").innerText = author; | ||
| }; | ||
|
|
||
| document.addEventListener("DOMContentLoaded", showNewQuote); | ||
|
|
||
| document.querySelector("button").addEventListener("click", showNewQuote); | ||
|
|
There was a problem hiding this comment.
I don’t see any trainee-written comments in this change set, only code. Since the functions and event listeners here are already quite clear (showNewQuote and the click handler are self-explanatory), this is a nice example of code that doesn’t need extra comments at all. As you keep working, you might ask yourself: whenever you feel the urge to add a comment, is there a way to make the code or naming so clear that the comment becomes unnecessary? That habit will keep your codebase easier to read and maintain.
To "like" or "dislike" this comment, please follow this link
|
The CYF AI review has left comments. It will only review a PR one time. When you have addressed these comments, please request review again and a volunteer will take a look. |
Learners, PR Template
Self checklist
Task code
CYF-1096
Changelist
Implements quote generator app.