Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sets and data structures in Google Apps Script

Tags:

People also ask

How do I declare an array in Google Apps Script?

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.

What programming language does Google Apps Script use?

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.

Is Google Apps Script similar to VBA?

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?