Results for “return”
Small, practical examples. Search by task or narrow things down below.
Return to the previously checked-out branch
Git: The dash shorthand selects the previous branch in the checkout history.
Git✓ Tested
Return two values from a function
Return two values from a function using a complete Go program with explicit sample inputs.
Go✓ Tested
Return typed data from an async function
Await a Promise and handle failures explicitly.
async✓ Tested
Return zero for a sum over no rows
SQL: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
SQL✓ Tested
Return zero for a sum over no rows
SQL Server: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
SQL Server✓ Tested
Return zero for a sum over no rows
Postgres: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
Postgres✓ Tested
Return zero for a sum over no rows
SQLite: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
SQLite✓ Tested
Run cleanup when a function returns
Run cleanup when a function returns using a complete Go program with explicit sample inputs.
Go✓ Tested
Clean up a generator after an early break
JavaScript: Breaking a for-of loop closes a generator and runs its finally block.
JavaScript✓ Tested
Clean up a generator after an early break
TypeScript: Breaking a for-of loop closes a generator and runs its finally block.
TypeScript✓ Tested
Inspect deleted rows
Return values from the rows a DELETE removes.
DELETE✓ Tested
Read values from an inserted row
Use RETURNING to retrieve an automatically assigned row ID.
RETURNING✓ Tested