I\'m trying to proper case a string in javascript - so far I have this code: This doesn\'t seem to capitalize the first letter, and I\'m also stuck on how to lowercase all the l
const titleCase = str => { let string = str.toLowerCase().split(" "); let arr = []; string.map(x =>arr.push(x[0].toUpperCase() + x.slice(1))) return arr.join(" "); }