Results for “code”
Small, practical examples. Search by task or narrow things down below.
Return an inserted row
Read generated data directly from INSERT.
RETURNING✓ Tested
Return multiple named values from a method
C#: Named value tuples give lightweight field names without a separate class.
C#✓ Tested
Return text from a shell function
Capture a function’s output with command substitution.
function✓ Tested
Return the first item with a generic function
Preserve the element type while allowing empty arrays.
generics✓ Tested
Return to the original branch
Git: Return to the original branch inside the disposable repository created by the input setup.
Git✓ Tested
Return to the previous collection in a chain
jQuery: end restores the selection before the last traversal operation.
jQuery✓ Tested
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