In Google script, after I split a string, I can't then get the length of the resulting array. I guess it's not an array? If so, how can I turn it into an array with a length value?
function splitAndCount() {
str = "33,34,35"; //example string
var stringSplit = str.split(","); //split string
return stringSplit.length(); //
// TypeError: Cannot call property length in object 33,34,35. It is not a function, it is "number".
}
It's not a function, it's property
function splitAndCount() {
str = "33,34,35"; //example string
var stringSplit = str.split(","); //split string
return stringSplit.length
}
console.log(splitAndCount())