The exercise under JAVASCRIPT called " Basic Algorithm Scripting: Title Case a Sentence". The code is down below:
function titleCase(str) {
var j, k='';
var n = str.split(' ')
var m = n.map((N) => {
j = N.charAt(0).toUpperCase() + N.slice(1).toLowerCase()
k = k + " " + j
})
console.log(k.trim())
// return str;
}
titleCase("sHoRt AnD sToUt");
Output: Short And Stout
Note: Any help would be really appreciated.