Unable to convert an array back to string by using join(” “)

I initially have a string whose words first letter I want to capitalize. After capitalization, I’m unable to convert the array back to string.
What’s wrong here?

const name = 'This is a beautiful day';
console.log(name)
const capitalizedName = name.split(' ');
for (let i = 0; i < capitalizedName.length; i++) {
capitalizedName[i] =
  capitalizedName[i][0].toUpperCase() + capitalizedName[i].substr(1);
}
capitalizedName.join(' ');
console.log(capitalizedName);

The output:-

This is a beautiful day
[ 'This', 'Is', 'A', 'Beautiful', 'Day' ]

Output that I was expecting:-

This is a beautiful day
This Is A Beautiful Day