Here is how you declare and initialize an array called colors . You list a number of values within square brackets ( [ and ] ). Arrays have an indexing system to help you access values stored at specific positions. The indexing system starts at 0 and not 1.
Google Apps Script is a coding language based on JavaScript that allows you to extend and manipulate Google apps like Drive, Sheets, Docs, and Gmail.
VBA merges similar capabilities to Google Forms, Apps Script, add-on-type user interfaces, and the object model into one platform. You need some or all of the Apps Script–related components to achieve the same thing.
Google Sheets's script editor seems to be a variant of JavaScript, but I can't figure out how to use it to handle Sets, dictionaries, etc. I already know how to use JS Arrays, but Arrays are not sufficient for my task.
Declaring a Set through the normal way (i.e. var categoryOptions = new Set(String);
gives me a 'Set is not defined' error.
Using var categoryOptions = {};
does not allow me to use any built-in Set functions, such as add
. Instead, I get: "TypeError: Cannot find function add in object [object Object]."
Any pro tips?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With