Skip to content

London | 26-ITP-Jan | Miriam Jorna | Sprint 3 | Quote generator#1202

Open
miriamjorna wants to merge 2 commits intoCodeYourFuture:mainfrom
miriamjorna:Quote-generator
Open

London | 26-ITP-Jan | Miriam Jorna | Sprint 3 | Quote generator#1202
miriamjorna wants to merge 2 commits intoCodeYourFuture:mainfrom
miriamjorna:Quote-generator

Conversation

@miriamjorna
Copy link
Copy Markdown

@miriamjorna miriamjorna commented Apr 16, 2026

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

Changelist

Made a quote generator as per instructions

@miriamjorna miriamjorna added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 16, 2026
Comment thread Sprint-3/quote-generator/quotes.js Outdated
function displayQuote() {
const randomQuote = pickFromArray(quotes);
quoteP.textContent = randomQuote.quote;
authorP.textContent = `- ${randomQuote.author}`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The leading - appears to be for styling purposes. Keeping it in the CSS or in HTML could allow us to adjust the view without changing any JavaScript code.

Comment thread Sprint-3/quote-generator/quotes.js Outdated
];

// call pickFromArray with the quotes array to check you get a random quote
pickFromArray(quotes);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should respect instructions like DO NOT EDIT BELOW HERE; it is usually there for a reason. If you are curious about why, you can ask AI Why should programmers respect "DO NOT EDIT BELOW HERE" instruction in a file?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you. I had read the
// call pickFromArray with the quotes array
as the end of the
DO NOT EDIT
section with a new instruction.

Comment thread Sprint-3/quote-generator/quotes.js Outdated
Comment on lines +11 to +15
window.onload = function() {
displayQuote();
};

newQuoteButton.addEventListener("click", displayQuote);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line 15 is also a run-on-load operation. You can consider keeping it in the "onload" callback function.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ah, of course. That makes more sense. Thank you!

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 17, 2026
@miriamjorna miriamjorna added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 17, 2026
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Looks great. Well done.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants