Q:

Write a JavaScript program to dcapitalize the first letter of a string

0

 Write a JavaScript program to dcapitalize the first letter of a string.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const decapitalize = ([first, ...rest], upperRest = false) =>
  first.toLowerCase() + (upperRest ? rest.join('').toUpperCase() : rest.join(''));
console.log(decapitalize('W3resource'))
console.log(decapitalize('Red', true));

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now