my function only returns the first letter, although capitalized, and not the rest of the letters. What am I doing wrong?

Hello everyone. I have a very beginner question: I am trying to write a function that returns a string with the first letter capitalized (I will paste code below). However, my function only returns the first letter, although capitalized, and not the rest of the letters. What am I doing wrong?
function capitalize (string) {
return string.charAt(0).toUpperCase();
}
You already invited:

Alex - designer

Upvotes from:

string functions do not modify the string they return new values
string.charAt(0) is only returning the first character, then toUpperCase() returns that character to upper case.
You will need to build a new string from the first string and the rest of that string

If you wanna answer this question please Login or Register