to capital case javascript
var str = "Hello World!";
var res = str.toUpperCase(); //HELLO WORLD!const toCapitalCase = (string) => {
return string.charAt(0).toUpperCase() + string.slice(1);
};function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
console.log(capitalizeFirstLetter('foo')); // Fooconst name = 'flavio'
const nameCapitalized = name.charAt(0).toUpperCase() + name.slice(1)
function capitalizeName(name) {
return name.replace(/\b(\w)/g, s => s.toUpperCase());
}
Also in JavaScript:
- how to draw flower petals around circle javascript
- javascript Prevent Object MutationPassed
- how to create multiple folders at once in node js
- invalid left-hand side in assignment
- js escape url parameter
- js scroll to top
- javascript get srollwidth
- react font awesome
- emit resize event in angular
- refresh javascript using require
- angular clone array without reference
- es6 array sum javascript
- find length of longest string in array javascript
- trigger button click jquery
- dropdown option selection change event in jquery
- javascript innertext vs innerhtml
- create react element with string
- swap function javascript
- js run html in blob
- getelementbyclass
- javascript have special characters
- p5.js script tag
- javascript keydown
- Prevent Multiple Form Submissions With JQuery