Skip to content
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

Peer to Peer to code review - Morning session #38

Closed
NitBravoA92 opened this issue Jun 30, 2023 · 0 comments
Closed

Peer to Peer to code review - Morning session #38

NitBravoA92 opened this issue Jun 30, 2023 · 0 comments

Comments

@NitBravoA92
Copy link

Congratulations @Kidd254 you have done a great job in this last Pull Request #33 πŸ‘πŸ™Œ

Highlights ⚑

  • βœ… Beautiful design. πŸ₯‡
  • βœ… Used of ES6 πŸ“ƒ

However, we would like to share with you a suggestion ♻️ that could make your project look even better.

  • In module popUp.js:

In your popUp() function, you have this code <h3 id="comments-header">Comments (0)</h3> that displays the title of the comments section and the comments counter using the function commentsCounter(). It could be much better to enclose the comment counter in a span tag and update it directly from your commentsCounter() function instead of updating the entire content of the h3 tag.

It could be something like this:

in your popUp() function:

<h3 id="comments-header">Comments (<span id="comment-counter">0</span>)</h3>

and in your commentsCounter() function:

const commentsNumber = document.getElementById('comment-counter');
commentsNumber.innerText = ${comments};

This could save you from having to render the word 'Comments' every time the comment counter is updated, which could benefit good code structuring and performance.

@HFG43 HFG43 closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants