-
-
Notifications
You must be signed in to change notification settings - Fork 220
London|25-ITP-September|Alexandru Pocovnicu|Sprint 3|Reading list #852
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
London|25-ITP-September|Alexandru Pocovnicu|Sprint 3|Reading list #852
Conversation
…ased on read status
jennethydyrova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @alexandru-pocovnicu! Very good work on this exercise. There are few comments I left that will make you code cleaner.
| ]; | ||
|
|
||
| function readingList() { | ||
| const unorderedList = document.querySelector("#reading-list"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a good name for the variable? Another thing, what if you code cannot find this dom element? How can you guard your function against it?
Sprint-3/reading-list/script.js
Outdated
| const title = book.title; | ||
| const author = book.author; | ||
| newImage.src = book.bookCoverImage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is okay but can you check how to destructure an object to get field values? This will make you code cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, this was interesting
Sprint-3/reading-list/script.js
Outdated
| newList.appendChild(paragraph); | ||
| newList.appendChild(newImage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you think of another way to append both paragraph and newImage in one line?
Sprint-3/reading-list/style.css
Outdated
| #reading-list img { | ||
| size: ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷♂️
|
Thank You. |
jennethydyrova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work!
| for (const book of books) { | ||
| const newList = document.createElement("li"); | ||
| const newImage = document.createElement("img"); | ||
| const { title, author, bookCoverImage } = book; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could do something more interesting. Just fyi
for (const {title, author, bookCoverImage, alreadyRead} of books) {}
Learners, PR Template
Self checklist
Changelist
In this PR I have looped through an array, created DOM elements and appended them to the DOM