-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
task complete #994
task complete #994
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
src/scripts/main.js
Outdated
parentForInput.insertBefore(label, input); | ||
}); | ||
|
||
function capitalizeString(str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we write this function shorter? like
str.slice(0, 1).toUpperCase() + str.slice(1),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's easy. But in this case name='firstName' transform to "FirstName" instead of "First Name"
I have to capitalize name and split words - so every word from capital letter.
- For each
input
setplaceholder
based oninput
name. Capitalize it.
src/scripts/main.js
Outdated
}); | ||
|
||
function capitalizeString(str) { | ||
const capitalizeStr = str.split('').reduce((acc, char, index) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use 'str', 'func' etc.
write full name please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Approved!
DEMO LINK