touppercase first letter in word in aarrayjavascript code example
Example 1: javascript uppercase first letter of each word
const str = 'captain picard';
function capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
const caps = str.split(' ').map(capitalize).join(' ');
caps; // 'Captain Picard'
Example 2: how to convert array to uppercase in javascript
var a = ['this','is','test'];
a.map(f=>{ return f.toUpperCase(); });