Skip to content

London | 26-ITP-May | Chinwe Chukwuma | Sprint 2 | Book-Library - #526

Open
ChinweP wants to merge 7 commits into
CodeYourFuture:mainfrom
ChinweP:feature/book-library
Open

London | 26-ITP-May | Chinwe Chukwuma | Sprint 2 | Book-Library#526
ChinweP wants to merge 7 commits into
CodeYourFuture:mainfrom
ChinweP:feature/book-library

Conversation

@ChinweP

@ChinweP ChinweP commented Aug 8, 2026

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

Changelist

Book library coursework completed following readme instructions.

@ChinweP ChinweP added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Flows The name of the module. labels Aug 8, 2026

@cjyuan cjyuan left a comment

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.

Can you check if any of this general feedback can help you further improve your code?
https://github.com/CodeYourFuture/Module-Data-Flows/blob/general-review-feedback/debugging/book-library/feedback.md

Doing so can help me speed up the review process. Thanks.

@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 Aug 8, 2026
@ChinweP

ChinweP commented Aug 10, 2026

Copy link
Copy Markdown
Author

Hi @cjyuan, thanks for your feedback. I've gone through the feedback and made several improvements to my Book Library. I've also tested the changes to make sure everything is still working correctly. Thanks again for your guidance.

@ChinweP ChinweP added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 10, 2026

@cjyuan cjyuan left a comment

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.

Changes look good. Well done.

@@ -1,103 +1,114 @@
let myLibrary = [];

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.

Can we declare myLibrary in a way that prevents it from being accidentally reassigned?

Comment on lines +22 to +26
const titleInput = document.getElementById("title");
const authorInput = document.getElementById("author");
const pagesInput = document.getElementById("pages");
const checkInput = document.getElementById("check");
const bookForm = document.getElementById("book-form");

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.

Common practice is keep all variable declarations at the beginning of the file (before function definition).

Comment on lines +44 to +48
if (!Number.isInteger(pageCount) || pageCount < 1) {
alert("Pages must be a positive whole number!");
return false;
}
const book = new Book(titleInput.value.trim(), authorInput.value.trim(), pageCount, checkInput.checked);

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.

Indentation is a bit off.

Comment on lines +52 to +55
titleInput.value = "";
authorInput.value = "";
pagesInput.value = "";
checkInput.checked = false;

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.

Could also call the .reset() method of the form element.

const deletedTitle = myLibrary[i].title;
myLibrary.splice(i, 1);
render();
alert(`You've deleted title: ${deletedTitle}`);

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.

alert() is a blocking function call. As a result, invoking it prevents the browser from updating the UI until the dialog is dismissed.

If time permits, research for approaches that allows the UI to update before displaying the alert dialog. (This is an optional change).

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 10, 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. Module-Data-Flows The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants