In Javascript how to make the first letter of a string uppercase / capitalize

You, JavaScriptES6
Back

Example scenarios are:

The code :

const capitalize = string =>
  string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
© Heshan Wanigasooriya.RSS

🍪 This site does not track you.