How to capitalize words in JavaScript:

js
function capitalize(value) {
    return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
}

capitalize('helLo');  // => Hello