Using Google Scripts I'm trying to return a string and I get an array.
The code is adapted from another answer: Find Cell Matching Value And Return Rownumber
function updateValues(sheet)
{ // loads named range "CalendarSettings" (on Reserved tab) into array dataSearch for later searching
dataRangeSearch = sheet.getRange("CalendarSettings");
dataSearch = dataRangeSearch.getValues().reduce(function (a, b) {return a.concat(b);});;
}
I was expecting that dataSearch would be a string, since I thought that a.concat(b) would result in a string.
"CalendarSettings" is a named range. Here is a screenshot of what the named range contains.
And here's a screenshot of a msgBox showing the contents of the variable dataSearch.
This looks like an array to me, and it behaves like an array in terms of how it is accessed. But what confuses me is that a.concat(b) I thought would be a string.