Method 1
const capitalize = word =>
word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
Method 2
const capitalize = ([firstLetter, ...otherLetters]) =>
firstLetter.toUpperCase() + otherLetters.join('').toLowerCase()
← CTRL+CMD+DOWN in VSCode
Show Comments