can we start variable with capital letter in javascript code example
Example 1: to capital case javascript
const toCapitalCase = (string) => {
return string.charAt(0).toUpperCase() + string.slice(1);
};
Example 2: javascript name capitalization
function capitalizeName(name) {
return name.replace(/\b(\w)/g, s => s.toUpperCase());
}