Results for “return”
Small, practical examples. Search by task or narrow things down below.
Distinguish an empty input line from end of input
Bash Scripts: A successful read can return an empty value; its status indicates whether a line was read.
Bash Scripts✓ Tested
Expose observation without exposing resolution
jQuery: promise returns an interface without resolve or reject methods.
jQuery✓ Tested
Extract a JSON field
Read a scalar value from JSON text.
json_extract✓ Tested
Extract all integer tokens from text
C#: Enumerate Match objects returned by Regex.Matches with an explicit timeout.
C#✓ Tested
Extract all regex matches with their groups
JavaScript: matchAll requires a global regular expression and returns an iterator of matches.
JavaScript✓ Tested
Extract all regex matches with their groups
TypeScript: matchAll requires a global regular expression and returns an iterator of matches.
TypeScript✓ Tested
Extract part of a date
Read a calendar component with EXTRACT.
EXTRACT✓ Tested
Filter and transform an array
Keep active objects and extract their names.
filter✓ Tested
Find both extremes in one algorithm call
C++: Check for a nonempty input before dereferencing the returned iterators.
C++✓ Tested
Find rows with a related record
Use EXISTS without duplicating the outer rows.
EXISTS✓ Tested
Find the first matching array item
JavaScript: find returns undefined when no item satisfies the predicate.
JavaScript✓ Tested
Find the first matching array item
TypeScript: find returns undefined when no item satisfies the predicate.
TypeScript✓ Tested