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

add task solution #1473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alex-marcovych
Copy link

- [DEMO LINK](https://alex-marcovych.github.io/js_task_fix_form_DOM/)

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on implementing the task requirements! 🎉 Your code is well-structured and meets all the specified constraints. The only minor point to consider is the behavior of the formatLabelText function, which defaults to capitalizing the first letter of the input name if it doesn't match any key in the labels object. While this is not a critical issue, you might want to expand the labels object or handle unexpected names differently in the future. Keep up the good work and continue refining your skills! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +19 to +25
function formatLabelText(text) {
const labels = {
firstName: 'First Name',
lastName: 'Last Name',
};

return labels[text] || text.charAt(0).toUpperCase() + text.slice(1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatLabelText function defaults to capitalizing the first letter of the input name if it doesn't match any key in the labels object. Ensure that this behavior is intended, as it might not be suitable for all input names. Consider expanding the labels object or handling unexpected names differently if needed.

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

Successfully merging this pull request may close these issues.

2 participants