What’s wrong with my code its returning “I’M A Little Tea Pot” instead of “I’m A Little Tea Pot’?
function titleCase(str) {
let a = str.toLowerCase();
let b = /\b[a-z]/g;
return a.replace(b, b => b.toUpperCase());
}
console.log(titleCase("I'm a little tea pot"));