You have two problems:
#1) You need to return a string and not array. You can use the join function in or before the return statement.
#2) The following line does not do what you think it does:
arr[i] = arr[i].toUpperCase();
To fix this issue, you need to replace the entire string with a new string which has the first letter capitalized and the rest of the string in lowercase. I will let you figure that part out on your own.