-
-
Notifications
You must be signed in to change notification settings - Fork 40
WM5 | ADNIYA YOUSAF | MODULE-JS2 | READINING LIST | WEEK 3 #87
base: main
Are you sure you want to change the base?
WM5 | ADNIYA YOUSAF | MODULE-JS2 | READINING LIST | WEEK 3 #87
Conversation
✅ Deploy Preview for cute-gaufre-e4b4e5 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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 looks good, but the code is formatted a little messily - can you clean it up a bit? Do you have VS Code configured to auto-format on save? If not, I'd recommend setting that up!
const bookName = document.createElement("p"); | ||
bookName.innerText = book.title + "-------"+book.author; | ||
li.appendChild(bookName); | ||
//Display author of the 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.
Your comments seem a little unrelated to the code they're each applying to - I'd maybe remove them.
//Display author of the book | ||
//Display title of the book | ||
const img = document.createElement("img"); | ||
img.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.
Can you make sure to run your code through a formatter like prettier so it's consistent and easier to read?
img.src = book.bookCoverImage; | ||
li.appendChild(img); | ||
|
||
if(book.alreadyRead===false){ |
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.
In general we don't tend to compare values with true
or false
.
An if
statement takes an expression which evaluates to a truthy value, so another way of writing if (book.alreadyRead === false)
is if (!book.alreadyRead)
- we tend to favour the !
approach over the === false
approach because it's more concise and we know alreadyRead
is already a boolean.
Ask any questions you have for your reviewer.