DiscoveryVIP / Apps Script AcademyHelp

Google Apps Script glossary

Google Apps Script

Google-hosted JavaScript plus service APIs for automating Workspace.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Google Workspace

Google productivity products such as Sheets, Docs, Drive and Gmail.

Automation repeats a defined rule on data. A reliable rule names its input, validates assumptions, changes only intended records and gives evidence of its effect. A computer does not infer that Pending means Complete. Writing B2:B4 changes three status cells in one explicit operation. The before-and-after view lets you verify both affected and unaffected cells.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2:B4").setValue("Ready");
}

Why it matters: A rectangular range can contain several cells; one scalar value is written to every cell.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Bound script

An Apps Script project attached to a host spreadsheet, document, form or presentation.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Standalone script

A script project created independently, typically opening target resources by ID.

getSheetByName accepts the exact tab name and returns a Sheet or null. Check null before invoking another method. An active spreadsheet exists only in suitable contexts; standalone scripts should open a configured ID. IDs are opaque identifiers, not the visible name. Fictional IDs work only in the local adapter.

function main() {
  const book = SpreadsheetApp.getActiveSpreadsheet();
  const sheet = book.getSheetByName("Sales");
  if (!sheet) throw new Error("Sales sheet missing");
  console.log(sheet.getName());
}

Why it matters: Case and spelling matter. The explicit guard gives a useful message instead of a null-property error.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Spreadsheet

A workbook containing one or more sheet tabs.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Sheet

One grid tab inside a spreadsheet; its name is not the workbook ID.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Range

A rectangular selection of cells on a sheet.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

A1 notation

A range address such as B2 or A2:C5, using letters for columns and one-based rows.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Spreadsheet ID

An opaque identifier used to open a workbook; not its visible title.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

File ID

A stable identifier for a Drive resource even when it is renamed.

A file ID identifies one resource while a name can be duplicated. A folder is a container, not a path string accepted by getFileById. Access depends on the executing account’s permissions. Store validated IDs in configuration and show clear errors for missing resources. The local tree uses stable fictional IDs and has no connection to Drive.

function main() {
  const file = DriveApp.getFileById("brief");
  console.log(file.getId());
  console.log(file.getName());
  console.log(file.getMimeType());
}

Why it matters: The stable ID returns the correct file even if its visible name later changes.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Document tab

A document content container accessed explicitly through a Tab and DocumentTab.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Service

A named Apps Script interface to a product or utility, such as SpreadsheetApp.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Method chaining

Calling a method on the object returned by the preceding call.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Authorization

Permission for code to use account data under a defined identity.

Authorization is permission granted for a script to use services on someone’s behalf. Console messages do not grant access. A successful log is not proof that every external side effect succeeded. Inspect state and exceptions as well. The simulation never requests Google authorization. In a real project inspect the requested scopes, the account and the code before approving access; organization administrators can restrict services.

function main() {
  console.log("Starting");
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  console.log(sheet.getName());
  console.log("Finished");
}

Why it matters: The normal sequence reaches Finished. An exception interrupts subsequent statements; it is not a Google authorization dialog.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

OAuth scope

A declared capability requested by a script for access to Google services.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Execution identity

The account authority under which an operation runs.

An event object describes an occurrence; it does not prove that the current viewer is authorized to perform every operation. Installable triggers run as their creator, while simple triggers have additional restrictions. User identity can be unavailable in some contexts. Treat event fields as optional and validate required inputs before acting.

function main() {
  if (!e) throw new Error("Select a prepared event");
  console.log(e.authMode);
  console.log(Boolean(e.range));
}

Why it matters: The prepared onEdit event has a range and a labeled auth-mode fixture; it is not a real account identity check.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Simple trigger

A reserved event function such as onOpen or onEdit with restricted capabilities.

Simple triggers run with restrictions and are not a general replacement for authorized installable triggers. A manual click on Run does not supply an event object automatically. Here the event selector prepares e explicitly. Use e.range to identify the edited cell and handle missing e with a clear guard. Avoid assuming every cell edit has a scalar e.value.

function main() {
  onEdit(e);
}
function onEdit(event) {
  if (!event || !event.range) throw new Error("Choose an onEdit event");
  console.log(event.range.getRow());
  console.log(event.value);
}

Why it matters: The prepared edit event identifies row two. Selecting Manual deliberately tests the missing-event guard.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Installable trigger

An explicitly created event or schedule handler that runs as its creator.

Simple triggers run with restrictions and are not a general replacement for authorized installable triggers. A manual click on Run does not supply an event object automatically. Here the event selector prepares e explicitly. Use e.range to identify the edited cell and handle missing e with a clear guard. Avoid assuming every cell edit has a scalar e.value.

function main() {
  onEdit(e);
}
function onEdit(event) {
  if (!event || !event.range) throw new Error("Choose an onEdit event");
  console.log(event.range.getRow());
  console.log(event.value);
}

Why it matters: The prepared edit event identifies row two. Selecting Manual deliberately tests the missing-event guard.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Time-driven trigger

An installed schedule that invokes a server function without an open browser.

A spreadsheet form-submit event supplies values and namedValues; a Form-bound event supplies response. Their handlers are not interchangeable. Test each event shape and document which trigger to install. A time-driven event is not a row submission and has no submitted values. This example expects the spreadsheet variant only.

function main() {
  if (!e || !Array.isArray(e.values)) throw new Error("Choose Spreadsheet form submission");
  console.log(e.values[1]);
  SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().appendRow([e.values[1], "Registered"]);
}

Why it matters: The prepared event’s second value is the person’s name; the first is a timestamp.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Event object

Input supplied by a trigger, whose fields depend on the event source.

Simple triggers run with restrictions and are not a general replacement for authorized installable triggers. A manual click on Run does not supply an event object automatically. Here the event selector prepares e explicitly. Use e.range to identify the edited cell and handle missing e with a clear guard. Avoid assuming every cell edit has a scalar e.value.

function main() {
  onEdit(e);
}
function onEdit(event) {
  if (!event || !event.range) throw new Error("Choose an onEdit event");
  console.log(event.range.getRow());
  console.log(event.value);
}

Why it matters: The prepared edit event identifies row two. Selecting Manual deliberately tests the missing-event guard.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

onEdit

A spreadsheet edit handler; programmatic cell writes do not automatically invoke it.

A trigger invokes a named function in response to an event or schedule. Creating a trigger is not the same as firing it. The simulator records trigger definitions and uses a separate event selector to invoke handlers. Script-driven sheet edits do not automatically fire onEdit. Avoid installing duplicate triggers each time setup runs.

function main() {
  ScriptApp.newTrigger("dailyReport").timeBased().everyDays(1).atHour(9).create();
  console.log(ScriptApp.getProjectTriggers().length);
}
function dailyReport() { console.log("Daily report started"); }

Why it matters: A daily trigger definition is stored. The report handler is not executed by setup itself.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

onOpen

A host-open handler commonly used to add a custom menu.

Simple triggers run with restrictions and are not a general replacement for authorized installable triggers. A manual click on Run does not supply an event object automatically. Here the event selector prepares e explicitly. Use e.range to identify the edited cell and handle missing e with a clear guard. Avoid assuming every cell edit has a scalar e.value.

function main() {
  onEdit(e);
}
function onEdit(event) {
  if (!event || !event.range) throw new Error("Choose an onEdit event");
  console.log(event.range.getRow());
  console.log(event.value);
}

Why it matters: The prepared edit event identifies row two. Selecting Manual deliberately tests the missing-event guard.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Form submission event

An occurrence with different structures for a Form source and a linked Sheet source.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Named values

A spreadsheet form-submit mapping from question titles to submitted value arrays.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

HTML Service

Apps Script output and templates for dialogs, sidebars and web pages.

HTML Service returns an HtmlOutput object, not a live DOM in server JavaScript. Display it through a bound editor UI or return it from doGet for a web app. Keep untrusted data out of raw HTML strings unless escaped. The academy preview is sandboxed and cannot access parent storage or Google services.

function main() {
  const output = HtmlService.createHtmlOutput("<h1>Review report</h1><p>Check totals before export.</p>");
  SpreadsheetApp.getUi().showModalDialog(output, "Report review");
}

Why it matters: A dialog record contains the title and authored HTML. No actual Google dialog opens locally.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Sidebar

A client HTML interface displayed beside a host editor document.

A sidebar is an HTML interface beside the host document. Its client JavaScript runs separately from server Apps Script. Use google.script.run callbacks for server data, not direct SpreadsheetApp calls in the page. The Web Application Studio provides an actual local asynchronous bridge for supported examples.

function main() {
  const output = HtmlService.createHtmlOutput("<h2>Administration</h2><p>Review sample records.</p>");
  SpreadsheetApp.getUi().showSidebar(output);
}

Why it matters: The sidebar state contains a distinct interface, while server and client environments remain separate.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Custom menu

Host editor commands mapping readable labels to server function names.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

CardService

The card UI API used for supported Google Workspace add-on experiences.

Editor add-ons and Google Workspace add-ons use different UI models and publication requirements. HTML sidebars are not interchangeable with CardService cards. Host applications expose different capabilities. This sample builds a card structure locally; installing it requires a reviewed add-on manifest and host-specific entry point in Google.

function main() {
  const section = CardService.newCardSection().addWidget(CardService.newTextParagraph().setText("Review automation before applying changes."));
  const card = CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle("Discovery toolkit")).addSection(section).build();
  console.log(JSON.stringify(card));
}

Why it matters: A card has a header and section with a text widget. The structural JSON is not an installed add-on.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Editor add-on

An extension of an editor with its own UI, authorization and publishing requirements.

Editor add-ons and Google Workspace add-ons use different UI models and publication requirements. HTML sidebars are not interchangeable with CardService cards. Host applications expose different capabilities. This sample builds a card structure locally; installing it requires a reviewed add-on manifest and host-specific entry point in Google.

function main() {
  const section = CardService.newCardSection().addWidget(CardService.newTextParagraph().setText("Review automation before applying changes."));
  const card = CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle("Discovery toolkit")).addSection(section).build();
  console.log(JSON.stringify(card));
}

Why it matters: A card has a header and section with a text widget. The structural JSON is not an installed add-on.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Workspace add-on

A host-specific card-based integration with distinct manifest and event contracts.

Editor add-ons and Google Workspace add-ons use different UI models and publication requirements. HTML sidebars are not interchangeable with CardService cards. Host applications expose different capabilities. This sample builds a card structure locally; installing it requires a reviewed add-on manifest and host-specific entry point in Google.

function main() {
  const section = CardService.newCardSection().addWidget(CardService.newTextParagraph().setText("Review automation before applying changes."));
  const card = CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle("Discovery toolkit")).addSection(section).build();
  console.log(JSON.stringify(card));
}

Why it matters: A card has a header and section with a text widget. The structural JSON is not an installed add-on.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Web application deployment

A published Apps Script HTTP entry with selected audience and execution identity.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

doGet

The server entry point for a web application GET request, returning supported output.

HTML Service returns an HtmlOutput object, not a live DOM in server JavaScript. Display it through a bound editor UI or return it from doGet for a web app. Keep untrusted data out of raw HTML strings unless escaped. The academy preview is sandboxed and cannot access parent storage or Google services.

function main() {
  const output = HtmlService.createHtmlOutput("<h1>Review report</h1><p>Check totals before export.</p>");
  SpreadsheetApp.getUi().showModalDialog(output, "Report review");
}

Why it matters: A dialog record contains the title and authored HTML. No actual Google dialog opens locally.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

doPost

A server entry point for HTTP POST requests with explicit validation and output.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

google.script.run

An asynchronous HTML-service bridge from browser code to allowed server functions.

A sidebar is an HTML interface beside the host document. Its client JavaScript runs separately from server Apps Script. Use google.script.run callbacks for server data, not direct SpreadsheetApp calls in the page. The Web Application Studio provides an actual local asynchronous bridge for supported examples.

function main() {
  const output = HtmlService.createHtmlOutput("<h2>Administration</h2><p>Review sample records.</p>");
  SpreadsheetApp.getUi().showSidebar(output);
}

Why it matters: The sidebar state contains a distinct interface, while server and client environments remain separate.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Success handler

A callback that consumes a completed server return value.

A success handler receives a server result; a failure handler receives an error. Do not read a result synchronously from google.script.run. Responses can arrive out of request order, so disable dependent actions or use request IDs. Dates and functions are not permitted bridge parameters; serialize dates deliberately. This server fixture is used by the working studio bridge.

function main() {
  console.log(getSummary());
}
function getSummary() {
  const rows = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Tasks").getDataRange().getValues().slice(1);
  return {count: rows.length, open: rows.filter(row => row[1] === "Open").length};
}

Why it matters: The serialized object reports the two total tasks and the one open task.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Failure handler

A callback for a rejected asynchronous server call.

google.script.run is asynchronous and returns control before the server result arrives. Register success and failure handlers, pass supported serializable data, and update the page in the callback. Server functions ending in an underscore are private to client calls. The server example returns data; open the Web Application Studio to exercise the paired client.

function main() {
  console.log(getPeople());
}
function getPeople() {
  return SpreadsheetApp.getActiveSpreadsheet().getSheetByName("People").getDataRange().getValues().slice(1);
}

Why it matters: The callable server function returns all three people without the header, ready for a client success handler.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Script Properties

String configuration shared by script executions, visible to sufficient project editors.

Treat transport failure, HTTP failure, parsing failure and schema failure as separate diagnoses. Retry only suitable transient failures with bounded attempts and delays. Keep credentials in reviewed server configuration, and remember project editors may read Script Properties. This example validates an allowlist rather than treating every parsed category as trusted.

function main() {
  const response = UrlFetchApp.fetch("https://example.com/fixture", {muteHttpExceptions: true});
  if (response.getResponseCode() !== 200) throw new Error("Provider unavailable");
  const data = JSON.parse(response.getContentText());
  if (!["support", "praise", "bug"].includes(data.category)) throw new Error("Unsupported category");
  console.log(data.category);
}

Why it matters: An allowed category passes. The failure lab can independently inject HTTP or JSON errors.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

User Properties

String settings scoped to a user in Google rather than all script users.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Document Properties

Document-scoped properties available only in supported project contexts.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Script lock

A coordination primitive for cooperating script executions sharing a script lock.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Checkpoint

A saved processing position or identifier allowing a bounded batch to resume.

Read source records once and create one document per intended record. Give each output a meaningful name and record its ID for recovery. Large batches need checkpoints and duplicate protection. A document generated with the wrong column mapping can look plausible, so verify actual names and amounts in the outputs, not merely the file count.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sales");
  const rows = sheet.getDataRange().getValues().slice(1);
  rows.forEach(row => {
    const doc = DocumentApp.create("Statement - " + row[0]);
    doc.getTabs()[0].asDocumentTab().getBody().appendParagraph(row[0] + " owes " + row[1]);
  });
}

Why it matters: Each customer gets a distinct document derived from the corresponding row, without altering Sales.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Idempotency

A property of an operation whose repeated execution has the intended same net effect.

A write replaces existing cell content. Read the old value when the update depends on it, compute locally and write deliberately. A setValue call is not a database transaction. Concurrent executions may need a cooperating lock and idempotency design. This introductory sample changes one amount and verifies the stored result.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sales");
  const cell = sheet.getRange("B2");
  cell.setValue(cell.getValue() + 10);
  console.log(cell.getValue());
}

Why it matters: The calculation uses the numeric input 120 and stores 130, leaving other records unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Mail merge

Mapping structured records into individual message content and recipients.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Draft approval

A human review of a specific recipient and message version before delivery.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Drive iterator

A hasNext/next interface for traversing potentially multiple resources.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Sharing access

Who may reach a resource, distinct from what permission each user receives.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Two-dimensional array

An outer row array containing inner arrays of cells.

getValues returns a two-dimensional array: an outer array of rows and an inner array of cells. values[1][0] means the first cell of the second row. Headers occupy index zero if the range includes them. Ensure rows have the expected shape before reading columns, and name column indexes to avoid unexplained numeric offsets.

function main() {
  const rows = [["Name", "Amount"], ["Alex", 120], ["Jordan", 80]];
  console.log(rows[1][0]);
  console.log(rows[2][1]);
}

Why it matters: The outer index chooses the row before the inner index chooses its column.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Batch write

One rectangular setValues operation instead of many separate cell writes.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Used range

The rectangle returned by getDataRange, which can include headers and unexpected cells.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Data validation rule

A constraint attached to cells; server automation still needs input validation.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Formula source

The expression beginning with =, distinct from its calculated value.

getValue reads the top-left cell; getValues reads the whole selected rectangle as nested arrays. Neither mutates cells. A displayed value and its underlying type can differ. Test values with typeof before arithmetic, and use getFormula when teaching formula source separately from its calculated result.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sales");
  const value = sheet.getRange("B2").getValue();
  console.log(value);
  console.log(typeof value);
}

Why it matters: B2 contains a number; A2 contains the customer’s text name.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Custom spreadsheet function

A deterministic returned calculation callable from a sheet formula under restrictions.

A custom function returns a value to a sheet formula rather than writing arbitrary cells. Keep it deterministic and avoid authorization-requiring services. A two-dimensional array return can spill into available neighboring cells. Test the pure function independently before entering it as a formula. The local function call is JavaScript, not a full Sheets formula evaluator.

function main() {
  console.log(DISCOUNT(100, 0.2));
}
function DISCOUNT(price, rate) {
  if (typeof price !== "number" || rate < 0 || rate > 1) throw new Error("Invalid price or rate");
  return price * (1 - rate);
}

Why it matters: The function returns 80, and its validation prevents rates outside zero through one.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Service call budget

A configurable local counter for experiments, not a fixed Google quota.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Quota exhaustion

A service usage limit preventing further work; current limits vary by account and method.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Authored fixture

Prepared deterministic example data clearly distinguished from a live service response.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Simulation adapter

A local implementation of selected service methods operating on fictional state.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Unsupported method

An API operation outside the local adapter contract that must fail visibly.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Manifest

The appsscript.json project configuration file controlling runtime and optional scopes or deployment metadata.

A file organizer should be repeatable and explicit about which resources it touches. Retrieve or create a destination, enumerate source files, filter candidates and move each intended file. This exercise copies into a new project folder to preserve inputs. In a real batch save a manifest of source and output IDs and test duplicate-name behavior.

function main() {
  const matches = DriveApp.getFoldersByName("Project Alpha");
  const folder = matches.hasNext() ? matches.next() : DriveApp.createFolder("Project Alpha");
  DriveApp.getFileById("brief").makeCopy("Project brief", folder);
  console.log(folder.getName());
}

Why it matters: The folder is reused if present. The source is copied, so repeated execution can still create duplicate copies to investigate.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

V8 runtime

Apps Script’s JavaScript runtime; it does not provide a browser document DOM.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Execution log

Diagnostic output from a run; it is evidence of messages rather than proof of all effects.

Authorization is permission granted for a script to use services on someone’s behalf. Console messages do not grant access. A successful log is not proof that every external side effect succeeded. Inspect state and exceptions as well. The simulation never requests Google authorization. In a real project inspect the requested scopes, the account and the code before approving access; organization administrators can restrict services.

function main() {
  console.log("Starting");
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  console.log(sheet.getName());
  console.log("Finished");
}

Why it matters: The normal sequence reaches Finished. An exception interrupts subsequent statements; it is not a Google authorization dialog.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Operation timeline

An ordered recording of actual local service calls, not a universal paused debugger.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Preview sandbox

An isolated iframe for client behavior with no parent-origin storage access.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Deployment audience

The set of users permitted to open a published application.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Restricted test deployment

A release limited to intended testers while identity and data exposure are checked.

Deployment settings determine who may open a web app and whose authority it uses. A working local preview does not validate real Google identity rules. Start with a restricted test deployment and a sample workbook. Review scopes, server validation, ownership and data exposure before expanding access. The exercise produces a concrete deployment checklist as data.

function main() {
  const policy = {audience: "testers", identityReviewed: true, inputValidation: true, sampleDataOnly: true};
  if (!policy.identityReviewed || !policy.inputValidation) throw new Error("Deployment review incomplete");
  console.log(JSON.stringify(policy));
}

Why it matters: The checklist fails closed when identity review is missing; it is not a real deployment API.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Gemini API

A model service called separately from the Apps Script editor’s Gemini side panel.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Model configuration

A reviewed endpoint and currently available model selected for an actual account.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Structured AI output

Model-proposed data checked against an application schema before use.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Human review gate

A specific approval step before applying or distributing a proposed result.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Source verification

Checking a derived statement against its actual input evidence.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Prompt injection

Untrusted content attempting to override the application’s instructions or authority.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Vibe Learning

Discover, predict, understand, experiment, build, test, explain, reflect and extend.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Vibe Teaching

Teaching through an observable problem, guided experiment and evidence-based explanation.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Disciplined Vibe Coding

Using AI assistance while checking requirements, source, tests and deployment assumptions.

A script is a sequence of instructions. Apps Script runs JavaScript on Google servers and exposes service objects such as SpreadsheetApp. Here the same method names operate only on fictional local data. The function groups instructions under a name; defining it does not execute it. Run Script calls the selected function. The returned Spreadsheet contains a Sheet, and its getRange method identifies a cell. A1 notation combines a column letter and a one-based row number. B2 is the first person’s status, not their name.

function main() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  sheet.getRange("B2").setValue("Complete");
}

Why it matters: getRange returns a Range object; setValue changes the selected cell. The name column stays unchanged.

Common misunderstanding: A local demonstration does not grant real Google permissions or establish correctness outside its stated test cases.

Related learning example

Programming

Writing instructions that a computer can execute.

Writing instructions that a computer can execute. The example shows its use in JavaScript source.

console.log("Hello");

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Program

A collection of instructions intended to accomplish a task.

A collection of instructions intended to accomplish a task. The example shows its use in JavaScript source.

console.log(2 + 3);

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Source code

The human-readable text of a program.

The human-readable text of a program. The example shows its use in JavaScript source.

let score = 1;

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Instruction

An operation described by source code.

An operation described by source code. The example shows its use in JavaScript source.

console.log("Run");

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Statement

A complete syntactic unit such as a declaration or expression statement.

A complete syntactic unit such as a declaration or expression statement. The example shows its use in JavaScript source.

let total = 5;

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Expression

Source that evaluates to a value.

Source that evaluates to a value. The example shows its use in JavaScript source.

5 * 3

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Value

A piece of data that a program can use.

A piece of data that a program can use. The example shows its use in JavaScript source.

42

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Syntax

The grammatical rules for valid source code.

The grammatical rules for valid source code. The example shows its use in JavaScript source.

console.log("Hello");

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Comment

Source text ignored during execution and intended for readers.

Source text ignored during execution and intended for readers. The example shows its use in JavaScript source.

// Explain the rule.

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Identifier

A name used to refer to a binding or other program entity.

A name used to refer to a binding or other program entity. The example shows its use in JavaScript source.

itemsInCart

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Keyword

A word reserved for a language construct.

A word reserved for a language construct. The example shows its use in JavaScript source.

const

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Semicolon

A statement separator or terminator in source syntax.

A statement separator or terminator in source syntax. The example shows its use in JavaScript source.

let x = 1;

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Parentheses

Symbols used for grouping or call argument lists.

Symbols used for grouping or call argument lists. The example shows its use in JavaScript source.

(5 + 2) * 3

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Brace

A symbol used to delimit blocks or object literals.

A symbol used to delimit blocks or object literals. The example shows its use in JavaScript source.

if (true) { console.log("yes"); }

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Bracket

A symbol used in array literals or property access.

A symbol used in array literals or property access. The example shows its use in JavaScript source.

items[0]

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Literal

Source syntax directly representing a value.

Source syntax directly representing a value. The example shows its use in JavaScript source.

"Hello"

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Console

A diagnostic interface where programs record messages.

A diagnostic interface where programs record messages. The example shows its use in JavaScript source.

console.log("Ready");

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Output

An observable result produced by execution.

An observable result produced by execution. The example shows its use in JavaScript source.

console.log(15);

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Input

Data supplied to a program or function.

Data supplied to a program or function. The example shows its use in JavaScript source.

greet("Alex")

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Algorithm

A defined sequence of steps for solving a problem.

A defined sequence of steps for solving a problem. The example shows its use in JavaScript source.

Read numbers, add them, display the sum.

Why it matters: Precise vocabulary helps you follow instructions and locate mistakes.

Common misunderstanding: A term names a particular concept, not proof that a program is correct.

Related learning example

Variable

A named binding used to access a value.

A named binding used to access a value. The example shows its use in JavaScript source.

let score = 3;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Binding

The association between a name and a value.

The association between a name and a value. The example shows its use in JavaScript source.

const title = "Course";

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Declaration

Syntax that introduces a binding.

Syntax that introduces a binding. The example shows its use in JavaScript source.

let count;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Assignment

An operation that stores a value in an existing binding.

An operation that stores a value in an existing binding. The example shows its use in JavaScript source.

count = 2;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Reassignment

Replacing the value associated with a binding.

Replacing the value associated with a binding. The example shows its use in JavaScript source.

count = 3;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

let

A block-scoped declaration that allows reassignment.

A block-scoped declaration that allows reassignment. The example shows its use in JavaScript source.

let count = 0;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

const

A block-scoped declaration that prevents reassignment of its binding.

A block-scoped declaration that prevents reassignment of its binding. The example shows its use in JavaScript source.

const rate = 0.1;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

var

An older function-scoped declaration with hoisting behavior.

An older function-scoped declaration with hoisting behavior. The example shows its use in JavaScript source.

var legacy = 1;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Data type

A category describing what a value is and which operations apply.

A category describing what a value is and which operations apply. The example shows its use in JavaScript source.

typeof 5

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

String

A primitive sequence of UTF-16 code units representing text.

A primitive sequence of UTF-16 code units representing text. The example shows its use in JavaScript source.

"JavaScript"

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Number

The standard numeric type using floating-point representation.

The standard numeric type using floating-point representation. The example shows its use in JavaScript source.

3.5

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Boolean

A primitive logical value, either true or false.

A primitive logical value, either true or false. The example shows its use in JavaScript source.

true

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

null

An explicit primitive value often representing intentional absence.

An explicit primitive value often representing intentional absence. The example shows its use in JavaScript source.

const selected = null;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

undefined

A primitive often observed when a value was not supplied or returned.

A primitive often observed when a value was not supplied or returned. The example shows its use in JavaScript source.

let pending;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

NaN

A numeric value representing an invalid numeric result.

A numeric value representing an invalid numeric result. The example shows its use in JavaScript source.

Number("not a number")

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Infinity

A numeric value beyond finite magnitude.

A numeric value beyond finite magnitude. The example shows its use in JavaScript source.

1 / 0

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

BigInt

An integer numeric type for arbitrarily large whole values.

An integer numeric type for arbitrarily large whole values. The example shows its use in JavaScript source.

123n

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Symbol

A primitive value with unique identity, often used as a property key.

A primitive value with unique identity, often used as a property key. The example shows its use in JavaScript source.

Symbol("id")

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Primitive

A non-object value such as a string, number or Boolean.

A non-object value such as a string, number or Boolean. The example shows its use in JavaScript source.

typeof "text"

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Type conversion

Creating a representation of a value in another type.

Creating a representation of a value in another type. The example shows its use in JavaScript source.

Number("12")

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Coercion

Conversion performed implicitly by a language operation.

Conversion performed implicitly by a language operation. The example shows its use in JavaScript source.

"5" + 2

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Truthy

A value that becomes true in Boolean context.

A value that becomes true in Boolean context. The example shows its use in JavaScript source.

Boolean("hello")

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Falsy

A value that becomes false in Boolean context.

A value that becomes false in Boolean context. The example shows its use in JavaScript source.

Boolean("")

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Immutability

The property of a value that cannot be changed in place.

The property of a value that cannot be changed in place. The example shows its use in JavaScript source.

"text".toUpperCase()

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Mutation

Changing the contents of an existing object or array.

Changing the contents of an existing object or array. The example shows its use in JavaScript source.

items.push("new");

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

State

The current values relevant to an application.

The current values relevant to an application. The example shows its use in JavaScript source.

let count = 0;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Reference

An identity-bearing relationship to an object value.

An identity-bearing relationship to an object value. The example shows its use in JavaScript source.

const other = original;

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Shallow copy

A new outer object that still shares nested referenced values.

A new outer object that still shares nested referenced values. The example shows its use in JavaScript source.

const copy = {...original};

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Deep copy

A copy that recreates supported nested data rather than sharing it.

A copy that recreates supported nested data rather than sharing it. The example shows its use in JavaScript source.

structuredClone(record)

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Serialization

Converting a supported value into a transport representation.

Converting a supported value into a transport representation. The example shows its use in JavaScript source.

JSON.stringify(record)

Why it matters: Bindings and types determine how calculations and state updates behave.

Common misunderstanding: The type belongs to the value; const does not deeply freeze an object.

Related learning example

Condition

An expression used to select a control-flow branch.

An expression used to select a control-flow branch. The example shows its use in JavaScript source.

score >= 5

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Branch

One possible path chosen by control flow.

One possible path chosen by control flow. The example shows its use in JavaScript source.

if (ready) { run(); }

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Loop

A construct that repeats operations while its rule allows it.

A construct that repeats operations while its rule allows it. The example shows its use in JavaScript source.

for (let i = 0; i < 3; i++) {}

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Iteration

One pass through a loop body.

One pass through a loop body. The example shows its use in JavaScript source.

console.log(i);

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Accumulator

A value carrying a running result across iterations.

A value carrying a running result across iterations. The example shows its use in JavaScript source.

sum += value;

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Counter

A binding that tracks a changing count or position.

A binding that tracks a changing count or position. The example shows its use in JavaScript source.

i++

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Infinite loop

Repetition whose stopping condition is never reached.

Repetition whose stopping condition is never reached. The example shows its use in JavaScript source.

while (true) {}

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Function

A callable unit of reusable behavior.

A callable unit of reusable behavior. The example shows its use in JavaScript source.

function double(n) { return n * 2; }

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Parameter

A binding declared to receive a function argument.

A binding declared to receive a function argument. The example shows its use in JavaScript source.

function greet(name) {}

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Argument

A value supplied in a call.

A value supplied in a call. The example shows its use in JavaScript source.

greet("Alex")

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Return value

The result given by a function to its caller.

The result given by a function to its caller. The example shows its use in JavaScript source.

return total;

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Callback

A function supplied to another operation for later or repeated invocation.

A function supplied to another operation for later or repeated invocation. The example shows its use in JavaScript source.

items.map(double)

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Arrow function

A function expression using arrow syntax and lexical this.

A function expression using arrow syntax and lexical this. The example shows its use in JavaScript source.

n => n * 2

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Scope

The region in which a binding can be accessed.

The region in which a binding can be accessed. The example shows its use in JavaScript source.

{ let local = 1; }

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Block scope

Visibility limited to the enclosing block.

Visibility limited to the enclosing block. The example shows its use in JavaScript source.

if (true) { let x = 1; }

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Global scope

The outer scope for a script environment.

The outer scope for a script environment. The example shows its use in JavaScript source.

globalThis

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Local scope

A scope belonging to an inner function or block.

A scope belonging to an inner function or block. The example shows its use in JavaScript source.

function f() { const local = 1; }

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Closure

A function retaining access to bindings from its creation environment.

A function retaining access to bindings from its creation environment. The example shows its use in JavaScript source.

function make(n) { return () => n; }

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Call stack

The active sequence of function calls waiting to finish.

The active sequence of function calls waiting to finish. The example shows its use in JavaScript source.

outer() calls inner()

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Stack frame

The execution context of a particular active function call.

The execution context of a particular active function call. The example shows its use in JavaScript source.

double(4)

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Recursion

A function invoking itself with a defined stopping case.

A function invoking itself with a defined stopping case. The example shows its use in JavaScript source.

factorial(n - 1)

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Base case

A condition that stops a recursive calculation.

A condition that stops a recursive calculation. The example shows its use in JavaScript source.

if (n === 0) return 1;

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Pure function

A function whose result depends on arguments and does not mutate external state.

A function whose result depends on arguments and does not mutate external state. The example shows its use in JavaScript source.

n => n * 2

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Side effect

An observable change outside a function’s returned value.

An observable change outside a function’s returned value. The example shows its use in JavaScript source.

element.textContent = "Updated";

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Hoisting

The observable early establishment of certain declarations in a scope.

The observable early establishment of certain declarations in a scope. The example shows its use in JavaScript source.

function declarations can be called before their source position

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Temporal dead zone

The region before a lexical binding is initialized where access throws.

The region before a lexical binding is initialized where access throws. The example shows its use in JavaScript source.

console.log(x); let x = 1;

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Destructuring

Syntax extracting values from arrays or object properties.

Syntax extracting values from arrays or object properties. The example shows its use in JavaScript source.

const {name} = person;

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Spread syntax

Syntax expanding iterable elements or copying object properties.

Syntax expanding iterable elements or copying object properties. The example shows its use in JavaScript source.

[...items]

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Rest parameter

A parameter collecting remaining arguments into an array.

A parameter collecting remaining arguments into an array. The example shows its use in JavaScript source.

function sum(...values) {}

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Default parameter

An initializer used when an argument is undefined.

An initializer used when an argument is undefined. The example shows its use in JavaScript source.

function greet(name = "friend") {}

Why it matters: Control flow and functions express decisions and reusable rules.

Common misunderstanding: A definition is not a call; returned values and console messages have different roles.

Related learning example

Array

An ordered, indexed object commonly used as a collection.

An ordered, indexed object commonly used as a collection. The example shows its use in JavaScript source.

["Learn", "Build"]

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Index

A numeric position used to access an array element.

A numeric position used to access an array element. The example shows its use in JavaScript source.

items[0]

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Element

A value stored at an array position.

A value stored at an array position. The example shows its use in JavaScript source.

items[1]

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Length

The array boundary or string code-unit count reported by length.

The array boundary or string code-unit count reported by length. The example shows its use in JavaScript source.

items.length

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Object

A value that groups named properties and has identity.

A value that groups named properties and has identity. The example shows its use in JavaScript source.

{name: "Alex"}

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Property

A key-value association on an object.

A key-value association on an object. The example shows its use in JavaScript source.

person.name

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Key

A string or symbol identifying an object property.

A string or symbol identifying an object property. The example shows its use in JavaScript source.

"name"

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Method

A callable property associated with an object.

A callable property associated with an object. The example shows its use in JavaScript source.

text.trim()

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Prototype

An object consulted during inherited property lookup.

An object consulted during inherited property lookup. The example shows its use in JavaScript source.

Object.getPrototypeOf(record)

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Class

Syntax for defining construction and prototype-based behavior.

Syntax for defining construction and prototype-based behavior. The example shows its use in JavaScript source.

class Counter {}

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Instance

An object created with a particular constructor.

An object created with a particular constructor. The example shows its use in JavaScript source.

new Counter()

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Constructor

A function used to initialize an object through new.

A function used to initialize an object through new. The example shows its use in JavaScript source.

constructor(name) { this.name = name; }

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

this

A binding whose value depends on the call form, except lexical arrows.

A binding whose value depends on the call form, except lexical arrows. The example shows its use in JavaScript source.

this.name

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Getter

An accessor invoked when a property is read.

An accessor invoked when a property is read. The example shows its use in JavaScript source.

get total() { return this.price * this.qty; }

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Setter

An accessor invoked when a property is assigned.

An accessor invoked when a property is assigned. The example shows its use in JavaScript source.

set value(n) { this._value = n; }

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Static method

A method available on the class constructor rather than instances.

A method available on the class constructor rather than instances. The example shows its use in JavaScript source.

Math.abs(-2)

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Map collection

A keyed collection supporting arbitrary value keys.

A keyed collection supporting arbitrary value keys. The example shows its use in JavaScript source.

new Map()

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Set collection

A collection of unique values.

A collection of unique values. The example shows its use in JavaScript source.

new Set([1,1,2])

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Iterable

A value providing an iterator used by constructs such as for...of.

A value providing an iterator used by constructs such as for...of. The example shows its use in JavaScript source.

for (const item of items) {}

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

Iterator

An object producing successive values with next().

An object producing successive values with next(). The example shows its use in JavaScript source.

items.values()

Why it matters: Collections let a program work with many values while preserving their identities.

Common misunderstanding: An array is an object; copying its binding does not copy its contents.

Related learning example

HTML

The markup language describing webpage structure and content.

The markup language describing webpage structure and content. The example shows its use in JavaScript source.

<button>Run</button>

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

CSS

The styling language describing webpage presentation.

The styling language describing webpage presentation. The example shows its use in JavaScript source.

button { color: green; }

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

DOM

The document tree exposed as objects to browser JavaScript.

The document tree exposed as objects to browser JavaScript. The example shows its use in JavaScript source.

document.body

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Node

An object participating in a document tree.

An object participating in a document tree. The example shows its use in JavaScript source.

element.firstChild

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Element node

A node representing an HTML or SVG element.

A node representing an HTML or SVG element. The example shows its use in JavaScript source.

document.createElement("p")

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Text node

A node containing literal document text.

A node containing literal document text. The example shows its use in JavaScript source.

document.createTextNode("Hello")

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Attribute

A named markup setting associated with an element.

A named markup setting associated with an element. The example shows its use in JavaScript source.

id="result"

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Selector

A pattern used to locate matching elements.

A pattern used to locate matching elements. The example shows its use in JavaScript source.

#result

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Event

An occurrence dispatched to an event target.

An occurrence dispatched to an event target. The example shows its use in JavaScript source.

click

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Event listener

A registered callback invoked for a specified event.

A registered callback invoked for a specified event. The example shows its use in JavaScript source.

button.addEventListener("click", handler)

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Event target

The node where an event originated.

The node where an event originated. The example shows its use in JavaScript source.

event.target

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Current target

The object whose listener is currently running.

The object whose listener is currently running. The example shows its use in JavaScript source.

event.currentTarget

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Bubbling

Propagation of an event through ancestor targets after its target phase.

Propagation of an event through ancestor targets after its target phase. The example shows its use in JavaScript source.

A button click reaches its parent listener.

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Capture phase

The propagation phase traveling toward the target before bubbling.

The propagation phase traveling toward the target before bubbling. The example shows its use in JavaScript source.

addEventListener("click", handler, true)

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Delegation

Handling child actions using an ancestor listener.

Handling child actions using an ancestor listener. The example shows its use in JavaScript source.

list.addEventListener("click", handler)

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Default action

A browser behavior associated with an event, such as form navigation.

A browser behavior associated with an event, such as form navigation. The example shows its use in JavaScript source.

event.preventDefault()

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Form validation

Checking whether submitted field values satisfy constraints.

Checking whether submitted field values satisfy constraints. The example shows its use in JavaScript source.

input.checkValidity()

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Accessibility

Designing functionality usable by people with varied access needs.

Designing functionality usable by people with varied access needs. The example shows its use in JavaScript source.

Use a labeled native button.

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Accessible name

The label exposed for an interactive element to accessibility APIs.

The label exposed for an interactive element to accessibility APIs. The example shows its use in JavaScript source.

aria-label="Increase count"

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Focus

The current keyboard interaction target.

The current keyboard interaction target. The example shows its use in JavaScript source.

input.focus()

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Live region

An area whose updates can be announced by assistive technology.

An area whose updates can be announced by assistive technology. The example shows its use in JavaScript source.

role="status"

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Rendering

Producing visible interface content from current state.

Producing visible interface content from current state. The example shows its use in JavaScript source.

render(records)

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Component

A bounded reusable unit of interface structure and behavior.

A bounded reusable unit of interface structure and behavior. The example shows its use in JavaScript source.

createCounter(container)

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Persistence

Retaining data across a page or application session.

Retaining data across a page or application session. The example shows its use in JavaScript source.

localStorage.setItem(key, text)

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Origin

The scheme, host and port used to isolate browser resources.

The scheme, host and port used to isolate browser resources. The example shows its use in JavaScript source.

https://example.test:443

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Sandbox

A restricted environment limiting the capabilities of executed content.

A restricted environment limiting the capabilities of executed content. The example shows its use in JavaScript source.

<iframe sandbox="allow-scripts">

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Web Worker

A separate execution context suited to non-DOM JavaScript work.

A separate execution context suited to non-DOM JavaScript work. The example shows its use in JavaScript source.

new Worker(url)

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

IndexedDB

An asynchronous browser database for structured local data.

An asynchronous browser database for structured local data. The example shows its use in JavaScript source.

indexedDB.open("academy", 1)

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

localStorage

A per-origin string-keyed browser storage interface.

A per-origin string-keyed browser storage interface. The example shows its use in JavaScript source.

localStorage.getItem("draft")

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Responsive layout

An interface adapting to different available display sizes.

An interface adapting to different available display sizes. The example shows its use in JavaScript source.

@media (max-width: 600px) {}

Why it matters: Browser vocabulary connects program data to real accessible user interfaces.

Common misunderstanding: A DOM element is an object; inserting untrusted HTML is different from inserting text.

Related learning example

Synchronous

Execution that proceeds in the current call sequence before returning control.

Execution that proceeds in the current call sequence before returning control. The example shows its use in JavaScript source.

console.log("A"); console.log("B");

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Asynchronous

Behavior whose result is delivered after the current sequence yields.

Behavior whose result is delivered after the current sequence yields. The example shows its use in JavaScript source.

setTimeout(handler, 0)

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Promise

An object representing eventual fulfillment or rejection.

An object representing eventual fulfillment or rejection. The example shows its use in JavaScript source.

Promise.resolve(5)

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Fulfillment

Successful settlement of a promise with a value.

Successful settlement of a promise with a value. The example shows its use in JavaScript source.

resolve(value)

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Rejection

Settlement of a promise with a failure reason.

Settlement of a promise with a failure reason. The example shows its use in JavaScript source.

reject(error)

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Pending

The unsettled state of a promise.

The unsettled state of a promise. The example shows its use in JavaScript source.

new Promise(() => {})

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

async function

A function whose call returns a promise.

A function whose call returns a promise. The example shows its use in JavaScript source.

async function load() { return 1; }

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

await

Syntax that suspends an async evaluation until a value’s promise settles.

Syntax that suspends an async evaluation until a value’s promise settles. The example shows its use in JavaScript source.

const result = await load();

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Task

A unit scheduled to run after the current task yields.

A unit scheduled to run after the current task yields. The example shows its use in JavaScript source.

A timer callback is a task.

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Microtask

A scheduled job drained at microtask checkpoints.

A scheduled job drained at microtask checkpoints. The example shows its use in JavaScript source.

Promise.resolve().then(handler)

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Event loop

The scheduling process coordinating tasks, microtasks and rendering opportunities.

The scheduling process coordinating tasks, microtasks and rendering opportunities. The example shows its use in JavaScript source.

A, D, C, B in the prepared example

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Timer

An API scheduling a callback no earlier than a requested delay.

An API scheduling a callback no earlier than a requested delay. The example shows its use in JavaScript source.

setTimeout(handler, 100)

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

API

A defined interface through which software requests data or behavior.

A defined interface through which software requests data or behavior. The example shows its use in JavaScript source.

fetch(url)

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

HTTP

The request/response protocol used for web resources.

The request/response protocol used for web resources. The example shows its use in JavaScript source.

GET /courses

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Request

A message asking a service for a resource or action.

A message asking a service for a resource or action. The example shows its use in JavaScript source.

fetch("/data")

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Response

The result message returned by a request operation.

The result message returned by a request operation. The example shows its use in JavaScript source.

response.status

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Status code

A numeric indication of an HTTP outcome.

A numeric indication of an HTTP outcome. The example shows its use in JavaScript source.

404

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Header

Metadata associated with a request or response.

Metadata associated with a request or response. The example shows its use in JavaScript source.

Content-Type: application/json

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

JSON

A text format for structured values with restricted syntax.

A text format for structured values with restricted syntax. The example shows its use in JavaScript source.

{"title":"Course"}

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

CORS

Browser-enforced cross-origin access rules for response visibility.

Browser-enforced cross-origin access rules for response visibility. The example shows its use in JavaScript source.

Access-Control-Allow-Origin

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Exception

A thrown value interrupting ordinary control flow.

A thrown value interrupting ordinary control flow. The example shows its use in JavaScript source.

throw new Error("Invalid");

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Runtime error

A failure occurring while code executes.

A failure occurring while code executes. The example shows its use in JavaScript source.

missingName()

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Syntax error

A parse failure caused by invalid source grammar.

A parse failure caused by invalid source grammar. The example shows its use in JavaScript source.

console.log("unclosed);

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Logic error

Behavior that runs but violates intended requirements.

Behavior that runs but violates intended requirements. The example shows its use in JavaScript source.

Using + where multiplication was required

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Debugging

Investigating observed behavior to locate and repair a defect.

Investigating observed behavior to locate and repair a defect. The example shows its use in JavaScript source.

Compare expected and actual values.

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Breakpoint

A debugger stopping point used to inspect an active execution.

A debugger stopping point used to inspect an active execution. The example shows its use in JavaScript source.

Pause at a chosen source line.

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Test

A repeatable check of behavior against an independent expectation.

A repeatable check of behavior against an independent expectation. The example shows its use in JavaScript source.

assert.equal(double(2), 4)

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Assertion

An explicit condition required by a test.

An explicit condition required by a test. The example shows its use in JavaScript source.

actual === expected

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Boundary case

An input at an edge of the defined behavior.

An input at an edge of the defined behavior. The example shows its use in JavaScript source.

An empty array

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Regression

A previously working behavior broken by a later change.

A previously working behavior broken by a later change. The example shows its use in JavaScript source.

A filter now loses saved selections.

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Module

A file-level unit with explicit imports and exports.

A file-level unit with explicit imports and exports. The example shows its use in JavaScript source.

export function double(n) { return n*2; }

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Dependency

A module or capability another unit requires.

A module or capability another unit requires. The example shows its use in JavaScript source.

import {double} from "./math.js";

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Refactoring

Changing structure while preserving intended behavior.

Changing structure while preserving intended behavior. The example shows its use in JavaScript source.

Extract a tested calculation helper.

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Requirement

An observable behavior or constraint the application must satisfy.

An observable behavior or constraint the application must satisfy. The example shows its use in JavaScript source.

Blank task names are rejected.

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Deployment

Making tested application files available in their target environment.

Making tested application files available in their target environment. The example shows its use in JavaScript source.

Upload HTML, CSS and JavaScript together.

Why it matters: Async and testing terms distinguish actual observations from assumptions.

Common misunderstanding: A fulfilled request can still have an unsuccessful HTTP status; passing checks do not prove every case.

Related learning example

Array.map

Creates an array from callback results for each existing source element.

Creates an array from callback results for each existing source element. The example shows its use in JavaScript source.

[1,2].map(n => n*2)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.filter

Creates an array of elements whose predicate is truthy.

Creates an array of elements whose predicate is truthy. The example shows its use in JavaScript source.

[1,2].filter(n => n>1)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.find

Returns the first matching element or undefined.

Returns the first matching element or undefined. The example shows its use in JavaScript source.

items.find(x => x.id === 1)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.findIndex

Returns the first matching position or -1.

Returns the first matching position or -1. The example shows its use in JavaScript source.

items.findIndex(x => x.done)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.some

Reports whether any element satisfies a predicate.

Reports whether any element satisfies a predicate. The example shows its use in JavaScript source.

items.some(x => x.done)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.every

Reports whether all existing elements satisfy a predicate.

Reports whether all existing elements satisfy a predicate. The example shows its use in JavaScript source.

items.every(x => x.done)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.reduce

Accumulates elements into a single result using a callback.

Accumulates elements into a single result using a callback. The example shows its use in JavaScript source.

[1,2].reduce((sum,n)=>sum+n,0)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.sort

Sorts an array in place using an optional comparison function.

Sorts an array in place using an optional comparison function. The example shows its use in JavaScript source.

[10,2].sort((a,b)=>a-b)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.slice

Returns a shallow section with an exclusive end boundary.

Returns a shallow section with an exclusive end boundary. The example shows its use in JavaScript source.

items.slice(1,3)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.splice

Removes or inserts elements in place and returns removed elements.

Removes or inserts elements in place and returns removed elements. The example shows its use in JavaScript source.

items.splice(1,1)

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.push

Appends elements in place and returns the new length.

Appends elements in place and returns the new length. The example shows its use in JavaScript source.

items.push("new")

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example

Array.pop

Removes and returns the last element.

Removes and returns the last element. The example shows its use in JavaScript source.

items.pop()

Why it matters: Built-in methods express common transformations with established contracts.

Common misunderstanding: Read whether a method mutates data, returns a value, or only schedules an operation.

Related learning example