Amit Dhamu

Software Engineer

Capitalize Word

Method 1

const capitalize = word =>
  word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()

Method 2

const capitalize = ([firstLetter, ...otherLetters]) =>
  firstLetter.toUpperCase() + otherLetters.join('').toLowerCase()

 spread / ucwords

CTRL+CMD+DOWN in VSCode

Show Comments

Made with by Amit Dhamu.
© MMXX. All rights reserved.