Skip to content

London | No Cohort | Daniel Wagner-Hall | Sprint 3 | Quote Generator - #1476

Closed
illicitestonion wants to merge 2 commits into
CodeYourFuture:mainfrom
illicitestonion:fixed
Closed

illicitestonion wants to merge 2 commits into
CodeYourFuture:mainfrom
illicitestonion:fixed

Conversation

@illicitestonion

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1096

Changelist

Implements quote generator app.

@illicitestonion illicitestonion added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 8, 2026
@cyf-ai-code-reviewer cyf-ai-code-reviewer Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 8, 2026
Comment on lines +7 to +9
document.addEventListener("DOMContentLoaded", () => { showNewQuote(); });

document.querySelector("button").addEventListener("click", () => { showNewQuote(); });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the two event listeners, you’re wrapping showNewQuote in an arrow function that only calls showNewQuote and doesn’t do anything else. Since those arrow functions don’t add any extra logic or clarity, they’re effectively “temporary” functions used once before their immediate use.

In cases like this, you might ask yourself: does this wrapper help readability or behavior in any way, or could I just pass the existing function directly? Here, passing showNewQuote directly would avoid creating an extra, single-use function while keeping the code easy to read.

The destructuring assignment const {quote, author} = pickFromArray(quotes); is a good use of a temporary value: you need a single random choice from quotes and then use both quote and author separately, so holding that result in a variable actually improves clarity and avoids calling pickFromArray twice.

To "like" or "dislike" this comment, please follow this link

@cyf-ai-code-reviewer cyf-ai-code-reviewer Bot added the Reviewed Volunteer to add when completing a review with trainee action still to take. label Oct 8, 2026
@cyf-ai-code-reviewer

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants