Skip to content

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

Closed
alexandru-pocovnicu wants to merge 13 commits intoCodeYourFuture:mainfrom
alexandru-pocovnicu:Sprint-3-Quote-Generator-App
Closed

London|26-ITP-January|Alexandru Pocovnicu|Sprint 3| quote generator app#984
alexandru-pocovnicu wants to merge 13 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
Comment thread Sprint-3/quote-generator/quotes.js Outdated
// 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

Comment thread Sprint-3/quote-generator/quotes.js Outdated
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 ?

Comment thread Sprint-3/quote-generator/quotes.js Outdated
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
Comment thread Sprint-3/quote-generator/quotes.js Outdated
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

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.

done

Comment thread Sprint-3/quote-generator/quotes.js Outdated
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?

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.

which line? the "if" starts the interval and without the "else" the interval doesn't stop even after the box is unchecked

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the line that this comment is on, line 521 which says interval = null;

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.

done

@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
@alexandru-pocovnicu alexandru-pocovnicu added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 12, 2026
@kyle-tightest kyle-tightest removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 22, 2026
@kyle-tightest kyle-tightest added the Complete Volunteer to add when work is complete and all review comments have been addressed. label Apr 22, 2026
@alexandru-pocovnicu
Copy link
Copy Markdown
Author

thank you

@illicitonion
Copy link
Copy Markdown
Member

Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants