Results for “return”
Small, practical examples. Search by task or narrow things down below.
Parse JSON into an object
Access a named field in a JSON document.
JSON✓ Tested
Pass behavior as a function delegate
C#: Func describes a callable with typed parameters and a return value.
C#✓ Tested
Read a fixed-size serial payload
Arduino / C: readBytes returns the number of bytes actually received.
Arduino / C✓ Tested
Read a JSONB field as text
Extract a nested value from a JSON document.
jsonb✓ Tested
Read a map with a default
Return a fallback when a Java map does not contain a key.
Java✓ Tested
Read a property with keyof
Keep the key and returned value tied to an object type.
keyof✓ Tested
Read a scalar JSON property
Extract a named value using a JSON path.
JSON_VALUE✓ Tested
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
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
Read an element’s document coordinates
jQuery: offset returns coordinates relative to the document.
jQuery✓ Tested
Read the current branch name
Git: show-current returns an empty string when HEAD is detached.
Git✓ Tested
Recover from an expected promise rejection
JavaScript: Return a fallback from catch so later handlers receive an ordinary resolved value.
JavaScript✓ Tested