AppsScriptPulse

Google Apps Script V8 variable scopes – var, const and let – Desktop liberation

One of the key things that V8 has sorted out is the scope of variables. Using var to declare variables meant that anything declared within the scope of a function could easily be accidentally overwritten, causing hard to track down errors. ES6 (since it’s commonly known as V8 in Apps Script – I’ll be referring to it as V8 from now on), has added const and let to the variable declaration vocabulary to help prevent these kind of problems.

With the introduction to the new Google Apps Script V8 runtime new opportunities are available for writing clean and robust code in the script editor using modern JavaScript syntax. In this post from Bruce Mcpherson you can learn some of the basics of var, const and let.

Source: JavaScript V8 variable scopes – Desktop liberation

List of over 130 shared Google Apps Script libraries developed by Bruce Mcpherson

Regular Google Apps Script Community contributor Bruce Mcpherson has published a list of all the Google Apps Script libraries he’s developed since 2012. The list includes links to the source repositories and if you spot a library you like the sound of you can search for more information on Bruce’s Desktop Liberation site .

Source: List of shared Apps Script libraries · Issue #31 · brucemcpherson/desktopliberation