What is Google Apps Script?
Google Apps Script is a scripting language for working with and automating Google’s services.
It’s based on JavaScript.
It’s especially often used together with Google Sheets, Google’s spreadsheet service.
Types of Google Apps Script
Section titled “Types of Google Apps Script”There are two types: standalone scripts, which you create as separate files in Google Drive, and container-bound scripts, which are bound to a Google Sheets, Docs, Slides, or Forms file.
Although they’re different types, the main difference is where they’re stored, and the way you write them is largely the same. However, there are some differences. For example, a container-bound script can’t be separated from the file it’s bound to, and it can get that file directly with methods such as SpreadsheetApp.getActiveSpreadsheet().
Coding conventions on this site
Section titled “Coding conventions on this site”The JavaScript standard (ECMAScript) is updated every year, and with the introduction of the V8 runtime, Google Apps Script now supports modern syntax such as let / const, arrow functions, classes, and template literals. Note that ES modules (import / export) aren’t supported.
For example, many sites that introduce Google Apps Script still use var to define variables, but this style tends to cause bugs and isn’t really recommended today.
With the current runtime, you can define variables with var, let, or const, and you can handle every variable definition with just let and const.
On this site, we write our samples using the newest syntax wherever possible.