Conversation
GabrielSpelchuk
commented
Feb 17, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because it correctly fulfills the core requirements: you create one table row per person, generate six cells with the right fields, compute age as died - born, compute century with Math.ceil(person.died / 100), and append each row to the .dashboard table. Functionally, this will work as expected in the given environment and does not contain any critical blockers.
Critical behavior is correct, but there are a couple of small improvements you could make next time: in src/scripts/main.js, add a guard after const table = document.querySelector('.dashboard'); (e.g., if (!table) return;) so the script won’t throw if the table is missing in another DOM setup, and rename the loop variable from persone to person for clarity and readability. These issues are non-blocking style/robustness points, not functional errors. Overall, solid work implementing the required table logic and calculations—well done.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
|
|
||
| // write your code here | ||
|
|
||
| const table = document.querySelector('.dashboard'); |
There was a problem hiding this comment.
Consider guarding the table lookup so the code fails gracefully if the element is missing. Right now table.appendChild(tr) will throw if document.querySelector('.dashboard') returns null. Example: if (!table) return; or throw a clear error. This improves robustness when DOM fixture is different.
|
|
||
| const table = document.querySelector('.dashboard'); | ||
|
|
||
| people.forEach((persone) => { |
There was a problem hiding this comment.
The loop variable persone looks like a typo. Rename it to person for clarity (people.forEach((person) => { ... })). This does not change functionality but improves readability.