Skip to content

Dagim H.#16

Open
Unlock7 wants to merge 1 commit into
HackYourAssignment:mainfrom
Unlock7:main
Open

Dagim H.#16
Unlock7 wants to merge 1 commit into
HackYourAssignment:mainfrom
Unlock7:main

Conversation

@Unlock7

@Unlock7 Unlock7 commented Feb 18, 2026

Copy link
Copy Markdown

No description provided.

@github-actions

Copy link
Copy Markdown

📝 HackYourFuture auto grade

Assignment Score: 0 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 0
🧪 The auto grade is experimental and still being improved

Test Details

@reposman33 reposman33 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.

Looks good... just some minor remarks

try {
fs.writeFileSync('books.json', JSON.stringify(books, null, 2), 'utf8');
} catch (error) {
console.log(chalk.red('Error saving books.json'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

always nice to display the error message or just part of it like this: error. message or error.detail

function addBook(book) {
// TODO: Implement this function
const books = loadBooks();
const nextId = books.length ? Math.max(...books.map((b) => b.id)) + 1 : 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice... we can' t assume an array of [1,2,3,4,5]. Maybe is is not sequentially ordered like [4,2,3,5,1].

function getBooksByGenre(genre) {
// TODO: Implement this function using filter()
return loadBooks().filter(
(book) => book.genre.toLowerCase() === genre.toLowerCase(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good catch to convert to lowercase first but genre can be converted outside the loop because it doesn't change (as opposed to book.genre). Devs like to see this attention to detail

// Use green for read books, yellow for unread
// Use cyan for titles
const books = loadBooks();
console.log(chalk.bold('\n📚 MY READING LIST 📚\n'));

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 have this console.log('📚 MY READING LIST 📚\n'); already on line 18 of app.js :)

@reposman33 reposman33 added Reviewed This assignment has been reivewed by a mentor and a feedback has been provided and removed Review in progress labels Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed This assignment has been reivewed by a mentor and a feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants