Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this task! Your script correctly adds the required labels and placeholders, and all functional requirements have been met. I am approving your solution.
As a point of feedback for future projects, I suggest using more descriptive variable names. For example, instead of single letters like k, m, and p, you could use names like inputName, allInputs, and inputId. This practice greatly improves code readability and makes it easier for others (and your future self) to understand and maintain. Keep up the great effort!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
src/scripts/main.js
Outdated
| let k = document.querySelectorAll('form .field .field-text'); | ||
|
|
||
| let m = Array.from(k); | ||
|
|
||
| m.forEach((el) => { | ||
| let k = el.getAttribute('name'); | ||
| let p = el.getAttribute('id'); |
There was a problem hiding this comment.
While this code works, using short, non-descriptive variable names like k, m, and p makes the code hard to understand. It's a best practice to use meaningful names that describe what the variable holds, for example, inputElements, inputName, or inputId.
Additionally, reusing the variable name k inside the loop (lines 3 and 8) is a practice called 'shadowing' and can be confusing. It's better to use a new, distinct variable name for the input's name attribute inside the loop.
No description provided.