capitalize algorithm
function capitalize1(str) {
const arrOfWords = str.split(" ");
const arrOfWordsCased = [];
for (let i = 0; i < arrOfWords.length; i++) {
const word = arrOfWords[i];
arrOfWordsCased.push(word[0].toUpperCase() + word.slice(1).toLowerCase());
}
return arrOfWordsCased.join(" ");
}
Also in JavaScript:
- javascript confirm tab close
- html select specify deafult select by js variable
- object methods in javascript
- html bind js file
- jquery edit iframe content
- in operator in javascript
- express validator always return error
- disable a button react
- blazor sample ujsing cliam policy
- chartjs random color line
- new date getday js
- change the position of div using javascript
- javascript resize event
- react native text input number only
- react list
- search bar in react js example
- user property in express jwt
- javascript convert number to spreadsheet column
- jquery append before
- how to get textedit on mac without download
- js date minus 18 years
- react component example
- react split array into chunks
- javascript es6 class