Skip to content

London|26-ITP-January|Alexandru Pocovnicu|Sprint 3| quote generator app#984

Open
alexandru-pocovnicu wants to merge 10 commits intoCodeYourFuture:mainfrom
alexandru-pocovnicu:Sprint-3-Quote-Generator-App
Open

London|26-ITP-January|Alexandru Pocovnicu|Sprint 3| quote generator app#984
alexandru-pocovnicu wants to merge 10 commits intoCodeYourFuture:mainfrom
alexandru-pocovnicu:Sprint-3-Quote-Generator-App

Conversation

@alexandru-pocovnicu
Copy link
Copy Markdown

@alexandru-pocovnicu alexandru-pocovnicu commented Mar 9, 2026

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

Changelist

wrote code to show random quote and author

@alexandru-pocovnicu alexandru-pocovnicu added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 9, 2026
// call pickFromArray with the quotes array to check you get a random quote

function chooseQuote() {
const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

welldone you have done a good job just a few things:
can we make the line easy to understand research KISS and SOC and DRY. can we do something to avoid repeating the line 496? its used in line 20 too

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

let interval = null;
autoGenerate.addEventListener("change", () => {
if (autoGenerate.checked) {
interval = setInterval(chooseQuote, 2000);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

what doeas 2000 mean? what are magic numbers ? and how can we handle magic numbers ?

const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];

const quote = document.getElementById("quote");
quote.innerText = randomQuote.quote;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can we use textContent instead of innerText and why ?
what happens if quote is null ?

@takanocap takanocap 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 Mar 18, 2026
@alexandru-pocovnicu
Copy link
Copy Markdown
Author

thank you

@alexandru-pocovnicu alexandru-pocovnicu added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 20, 2026
const randomQuote = pickFromArray(quotes)

const quote = document.getElementById("quote");
if(quote!==null){
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

please check spacing here and elsewhere, use the style guide as reference

interval = setInterval(chooseQuote, changeQuoteInterval);
} else {
clearInterval(interval);
interval = null;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this line may not be necessary, try removing it and see if it works?

@kyle-tightest kyle-tightest 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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants