Skip to content

West-Midlands | 26-ITP-May | Maryam Janjua | Sprint 2 | Book Library - #573

Open
maryam-devio wants to merge 1 commit into
CodeYourFuture:mainfrom
maryam-devio:feature/book-library
Open

West-Midlands | 26-ITP-May | Maryam Janjua | Sprint 2 | Book Library#573
maryam-devio wants to merge 1 commit into
CodeYourFuture:mainfrom
maryam-devio:feature/book-library

Conversation

@maryam-devio

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

In this task, we were required to identify and debug errors in the Book Library application. I fixed the bugs related to displaying, adding, and deleting books, as well as the author and read status. I also tested the application to make sure the required functionality works correctly.

@maryam-devio maryam-devio added 🏕 Priority Mandatory This work is expected 📅 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. and removed Module-Data-Flows The name of the module. labels Aug 21, 2026
@Khantdotcom Khantdotcom added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 25, 2026

@Khantdotcom Khantdotcom left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Mandatory changes required:

  • populateStorage()


window.addEventListener("load", function (e) {
populateStorage();
render();

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 you check your populateStorage() function whether it is single purpose function? Hint : you're doing something twice. I assume this is a typo but read this article to better understand Single Responsibility Principle here.

@@ -31,15 +31,21 @@
if (
title.value == 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.

If the input is empty, it returns an empty string "", it will never return null.

Comment on lines 33 to 37
title.value == "" ||
author.value == null ||
author.value == "" ||
pages.value == null ||
pages.value == ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can use the .trim() method for checking and javascript's truthiness to improve the logic. Read this article -> here

myLibrary.splice(i, 1);
render();
});
delButton.id = i + 5;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Instead of using the id attribute, modern JavaScript uses data- attributes to store hidden data (like the array index) on elements. Just a tip , not mandatory changes needed. Read this article here.

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

Labels

🏕 Priority Mandatory This work is expected Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants