You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
lang-js
/^[a-z]/iwill be better than using.as the prior one will not try to replace any character other than alphabetsstringvariable (that most other answers assume there is). For example:const date = new Date("2024年08月12日").toLocaleDateString("fr-FR", { weekday: "long", year: "numeric", month: "long", day: "numeric" }).replace(/^./, str => str.toUpperCase());. Using the string concatenation solution would require putting the locale date string in a variable first (or worse, repeating the full date method).