Comments in Apps Script

Last updated: March 08, 2025

You can add comments to your code to help others understand what your code does. Apps Script will ignore comments so your program's output will not change because of comments.

Single line comments

These are used to add short, one-line comments. Use two forward slashes (//) to add a single-line comment. Apps Script will ignore all the text following // on the same line.

// This is a single-line comment.
let maxPrice = $1000; //max price was decided by John Raymond (VP sales)

Multi-line comments

These are used to add more detailed comments in your code. As the name suggests, these can span multiple lines.

Use a forward slash and an asterisk (/*) to start a multi-line comment and an asterisk and forward slash (*/) to end it. Apps Script will ignore the text in-between /* and */.

/*
This helpful comment describes what the myFavNumber function does.
The myFavNumber function returns Ryan Jackson's favorite number.
Ryan's favorite number keeps changing so this function was last updated in June 2019.
The next update will be made in July 2019.
*/
function myFavNumber() {
  return 3;
}

DISCLAIMER: This content is provided for educational purposes only. All code, templates, and information should be thoroughly reviewed and tested before use. Use at your own risk. Full Terms of Service apply.

Small Scripts, Big Impact

Join 1,500+ professionals who are supercharging their productivity with Google Sheets automation

Exclusive Google Sheets automation tutorials and hands-on exercises
Ready-to-use scripts and templates that transform hours of manual work into seconds
Email updates with new automation tips and time-saving workflows

By subscribing, you agree to our Privacy Policy and Terms of Service