Snippets Collections
function capitalize(word, capitalize) {
        return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase();
}

// Sample usage - do not modify
console.log(capitalize("sam")); // "Sam"
console.log(capitalize("ALEX")); // "Alex"
console.log(capitalize("chARLie")); // "Charlie"
star

Mon Oct 31 2022 00:26:12 GMT+0000 (Coordinated Universal Time)

#substring #slice

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension