Skip to content

London | May-2025 | Ikenna Agulobi | Data Groups | sprint 3 | Reading List #704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ike-agu
Copy link

@ike-agu ike-agu commented Jul 25, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.
This PR includes my completed Reading List app for Sprint 3 - Data Groups module.

Questions

Ask any questions you have for your reviewer.

@ike-agu ike-agu added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 25, 2025
margin-top: 50px;
}

.read{
Copy link

Choose a reason for hiding this comment

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

the colour for read class should be green to pass the test!

background-color: red;
}

.not-read{
Copy link

Choose a reason for hiding this comment

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

the colour for not-read class should be red to pass the test! - check the reading-list.png for expected result.

@@ -21,3 +21,34 @@ const books = [
},
];

function readingList(books) {
Copy link

Choose a reason for hiding this comment

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

Could you rename the function starting with verb, and describe the action more clearly?

Comment on lines +36 to +40
if (books[i].alreadyRead) {
li.classList.add("read"); // If true, add the 'read' class
} else {
li.classList.add("not-read"); // If false, add the 'not-read' class
}
Copy link

Choose a reason for hiding this comment

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

This works fine, but this lines of code can be written in one line using a ternary operator. Can you refactor the code?

function readingList(books) {
const readingListUl = document.getElementById("reading-list");

for (let i = 0; i < books.length; i++) {
Copy link

Choose a reason for hiding this comment

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

Can you refactor a code to use forEach method with books array?

Copy link

@day-lee day-lee Jul 29, 2025

Choose a reason for hiding this comment

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

Have you run the tests? There are two failing tests. Please take a look. Otherwise, everything else works as intended!

@day-lee day-lee 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 Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review with trainee action still to take.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants