Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to capitalize the first letterr in an array

const days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];

let capitalize = days.map(day => day.charAt(0).toUpperCase() + day.slice(1).toLowerCase());

console.log(capitalize);
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #capitalize #letterr #array
ADD COMMENT
Topic
Name
2+8 =