Javascript Challenges - How to Uppercase The First Letter in Each Word

preview_player
Показать описание
Use Javascript to uppercase the first letter in each word of a given string.

Рекомендации по теме
Комментарии
Автор

Hey man. Really love your teaching style! Thanks for the vid

realcourier
Автор

Thank you, i got a little lost, but i found my way back.

alanrobbo
Автор

i'm more confused now, weird ending

CAMiniVans
Автор

It's wrong! Won't work if the word has the first letter twice or more in it.
Example:
aMaZoN -> AmAzon

Because you're replacing the letter A in the entire word, not the first char.

The correct function that must be inside map is this:

function (val)
{
return
}

It will get the first char, set it to upper case an then concatenate with all chars of the word starting from position 1.

joaojvr