How to define global variable in Google Apps Script

I see most examples from Google is they use only functions in a single giant script. e.g. https://developers.google.com/apps-script/quickstart/macros But in our style, we usually write all funct...