decapitalize
Decapitalizes the first letter of a string.
- Use array destructuring and
String.prototype.toLowerCase()
to decapitalize first letter,...rest
to get array of characters after first letter and thenArray.prototype.join('')
to make it a string again. - Omit the
upperRest
argument to keep the rest of the string intact, or set it totrue
to convert to uppercase.