I am very new to JS. I wrote a simple function in Google Script. It worked well in Google Sheets. But, give an error when the sheet is downloaded as Microsoft Excel. My function if as below.
function test(input){
var str = "";
for(i=0; i<input.length; i++){
for(j=0; j<input[i].length; j++){
var char0 = input[i][j].charAt(0).toUpperCase();
var sub = input[i][j].substr(1,input[i][j].length);
str = str.concat(char0,sub,",");
}
}
return str;
}