How to capitalize the first word of an input string. Using JavaScript
const str = 'flex';
const str2 = str.charAt( 0 ).toUpperCase() + str.slice(1);
console.log(str2);
//Output: Flex
const str = 'flex panel';
const str2 = str.charAt( 0 ).toUpperCase() + str.slice(1);
console.log(str2);
//Output: Flex panel