How do I make the first letter of a string uppercase in JavaScript?
Asked 07 September, 2021
Viewed 2.5K times
  • 55
Votes

How do I make the first letter of a string uppercase, but not change the case of any of the other letters?

For example:

  • "this is a test""This is a test"
  • "the Eiffel Tower""The Eiffel Tower"
  • "/index.html""/index.html"

30 Answer