captitalize js
JavaScript
function capitalize2(str) {
str = str.toLowerCase();
const arrOfWords = str.split(" ");
const arrOfWordsCased = [];
for (let i = 0; i < arrOfWords.length; i++) {
const char = arrOfWords[i].split("");
char[0] = char[0].toUpperCase();
res.push(char.join(""));
}
return arrOfWordsCased.join(" ");
}//capitalize only the first letter of the string.
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
//capitalize all words of a string.
function capitalizeWords(string) {
return string.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
};const lower = 'this is an entirely lowercase string';
const upper = lower.charAt(0).toUpperCase() + lower.substring(1);
Also in JavaScript:
- Title
- how to get local storage value in javascript
- Category
- JavaScript
- Title
- button style not working react native
- Category
- JavaScript
- Title
- default pool size in sequelize
- Category
- JavaScript
- Title
- firebase configuration on functions
- Category
- JavaScript
- Title
- fetch post js
- Category
- JavaScript
- Title
- find and delete element from array js
- Category
- JavaScript
- Title
- funcao com o botao esc do teclado javascript
- Category
- JavaScript
- Title
- array methods in javascript
- Category
- JavaScript
- Title
- how to get value in array object value using for loop in javascript
- Category
- JavaScript
- Title
- for of array javascript
- Category
- JavaScript
- Title
- function prototype javascript
- Category
- JavaScript
- Title
- angular event scroll end of page
- Category
- JavaScript
- Title
- how to map over arrays vuejs
- Category
- JavaScript
- Title
- eval in js
- Category
- JavaScript
- Title
- how to add property to object in javascript
- Category
- JavaScript
- Title
- angular add object to array
- Category
- JavaScript
- Title
- append to array js
- Category
- JavaScript
- Title
- Finding HTML Element by Id
- Category
- JavaScript
- Title
- iterate through nested object javascript
- Category
- JavaScript
- Title
- angular material theme colors
- Category
- JavaScript
- Title
- how to host react app on heroku
- Category
- JavaScript
- Title
- how to add border to a text in html with javascript
- Category
- JavaScript
- Title
- .push js
- Category
- JavaScript
- Title
- how to generate random string in javascript
- Category
- JavaScript
- Title
- facebook integration in node.js
- Category
- JavaScript
- Title
- calling function from function object javascript
- Category
- JavaScript
- Title
- fetch api react
- Category
- JavaScript
- Title
- google maps api javascript
- Category
- JavaScript
- Title
- how to update angular version
- Category
- JavaScript
- Title
- count occurrences of character in string javascript
- Category
- JavaScript
- Title
- Basic JavaScript: Use Recursion to Create a Range of Numbers
- Category
- JavaScript
- Title
- how to write img jsx
- Category
- JavaScript
- Title
- check if string is datestring javascript
- Category
- JavaScript
- Title
- how to remove duplicate array object in javascript
- Category
- JavaScript
- Title
- how to make a inventory in js
- Category
- JavaScript
- Title
- javascript add function to onchange event
- Category
- JavaScript
- Title
- how to add array numbers in javascript
- Category
- JavaScript
- Title
- array data structure javascipt interview questions
- Category
- JavaScript
- Title
- for Loop continue
- Category
- JavaScript
- Title
- change innertext javascript
- Category
- JavaScript
- Title
- how the map function works javascript
- Category
- JavaScript
- Title
- if condition in class angular 8
- Category
- JavaScript
- Title
- javascript add class to element
- Category
- JavaScript
- Title
- elasticsearch test node.js
- Category
- JavaScript
- Title
- html how to type a long string in many lines
- Category
- JavaScript
- Title
- input in javascript
- Category
- JavaScript
- Title
- access angular app outside localhost
- Category
- JavaScript
- Title
- addeventlistener on document in react js
- Category
- JavaScript
- Title
- get input value in angular 7
- Category
- JavaScript
- Title
- how to send a command in js
- Category
- JavaScript
- Title
- flatten nested object js
- Category
- JavaScript
- Title
- arrays javascript
- Category
- JavaScript
- Title
- how to check string uppercase or lowersace using regex javascript
- Category
- JavaScript
- Title
- ionic react use yarn
- Category
- JavaScript
- Title
- create react app deployment heroku
- Category
- JavaScript
- Title
- how to make a text editor in html
- Category
- JavaScript
- Title
- how to access a database in express
- Category
- JavaScript
- Title
- express server replit
- Category
- JavaScript
- Title
- append new element for each value in array d3.js
- Category
- JavaScript
- Title
- foreach w3schools javascript
- Category
- JavaScript
- Title
- iso to date javascript
- Category
- JavaScript
- Title
- express and node
- Category
- JavaScript
- Title
- how to format unix timestamp javascript
- Category
- JavaScript
- Title
- how to get element from arraylist react
- Category
- JavaScript
- Title
- how to do bubble sort in javascript
- Category
- JavaScript
- Title
- iterate through list javascript
- Category
- JavaScript
- Title
- array matching
- Category
- JavaScript
- Title
- How to check whether a string contains a substring in JavaScript?
- Category
- JavaScript
- Title
- import json file javascript
- Category
- JavaScript
- Title
- how to check if 2 sprites are touching js
- Category
- JavaScript
- Title
- array.filter in js
- Category
- JavaScript
- Title
- error Unexpected end of JSON input while parsing near '...
- Category
- JavaScript
- Title
- express bodyparser deprecated
- Category
- JavaScript
- Title
- hashing in javascript
- Category
- JavaScript
- Title
- angular material table
- Category
- JavaScript
- Title
- get the index of object in array
- Category
- JavaScript
- Title
- how to add validator to formgroup
- Category
- JavaScript
- Title
- how to split an array in javascript
- Category
- JavaScript
- Title
- call javascript function after page load complete
- Category
- JavaScript
- Title
- como utilizar jquery
- Category
- JavaScript
- Title
- events js 292 throw er Unhandled 'error' event ^ Error getaddrinfo ENOTFOUND x86_64-apple-darwin13.4.0 at GetAddrInfoReqWrap.onlookup [as oncomplete]
- Category
- JavaScript
- Title
- how to concatenate strings javascript
- Category
- JavaScript
- Title
- javascript closure stack overflow
- Category
- JavaScript
- Title
- firestore batch add array
- Category
- JavaScript
- Title
- click doesn't work on ajax loaded data
- Category
- JavaScript
- Title
- create a json object in javascript
- Category
- JavaScript
- Title
- angular ngclass
- Category
- JavaScript
- Title
- audio get current time
- Category
- JavaScript
- Title
- Alert.alert closing expo
- Category
- JavaScript
- Title
- async await catch error
- Category
- JavaScript
- Title
- html inline javascript
- Category
- JavaScript
- Title
- get month in two digit in javascript date
- Category
- JavaScript
- Title
- function to create an element javascript
- Category
- JavaScript
- Title
- Error: Can't resolve 'fs' webpack
- Category
- JavaScript
- Title
- create element javascript with class
- Category
- JavaScript
- Title
- how to make a textarea unwritable in react native
- Category
- JavaScript
- Title
- javascript check if string contains substring
- Category
- JavaScript
- Title
- command to create react app
- Category
- JavaScript
- Title
- change value of drop down using jquery
- Category
- JavaScript
- Title
- forever loop in js
- Category
- JavaScript