FIND YOUR NEXT FEW LINES

Results for “return”

Small, practical examples. Search by task or narrow things down below.

139 snippets foundClear filters
PowerShellText & data

Parse JSON into an object

Access a named field in a JSON document.

JSON✓ Tested
C#Types & reliable control flow

Pass behavior as a function delegate

C#: Func describes a callable with typed parameters and a return value.

C#✓ Tested
Arduino / CSerial protocols

Read a fixed-size serial payload

Arduino / C: readBytes returns the number of bytes actually received.

Arduino / C✓ Tested
PostgresJSON & arrays

Read a JSONB field as text

Extract a nested value from a JSON document.

jsonb✓ Tested
JavaCollections

Read a map with a default

Return a fallback when a Java map does not contain a key.

Java✓ Tested
TypeScriptUtilities & async

Read a property with keyof

Keep the key and returned value tied to an object type.

keyof✓ Tested
SQL ServerJSON & results

Read a scalar JSON property

Extract a named value using a JSON path.

JSON_VALUE✓ Tested
CFile positioning & lifecycle

Read a stream again from its beginning

C: rewind returns a seekable stream to offset zero and clears its error and EOF indicators.

C✓ Tested
C++Ownership & optional values

Read a variant only when it holds the expected type

C++: get_if returns a null pointer rather than throwing for another active alternative.

C++✓ Tested
jQueryCollections & styling

Read an element’s document coordinates

jQuery: offset returns coordinates relative to the document.

jQuery✓ Tested
GitBranches & ancestry

Read the current branch name

Git: show-current returns an empty string when HEAD is detached.

Git✓ Tested
JavaScriptPromises & iteration protocols

Recover from an expected promise rejection

JavaScript: Return a fallback from catch so later handlers receive an ordinary resolved value.

JavaScript✓ Tested