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