Results for “return”
Small, practical examples. Search by task or narrow things down below.
Render nothing from an optional component
Render nothing from an optional component with a small React component and explicit browser behavior.
React✓ Tested
Test a function’s success status
Bash Scripts: Test a function’s success status with a small standalone Bash program.
Bash Scripts✓ Tested
Use a function’s exit status as a boolean result
Bash Scripts: Return zero for success and test the function directly in a conditional.
Bash Scripts✓ Tested
Abort a conflicting cherry-pick
Git: Abort removes the incomplete replay and returns to the previous branch state.
Git✓ Tested
Abort a conflicting rebase
Git: Abort returns the branch to its state before the rebase attempt.
Git✓ Tested
Add an interval to a date
Perform calendar arithmetic with an interval literal.
INTERVAL✓ Tested
Add days to a date
Use a date modifier for calendar arithmetic.
date✓ Tested
Await multiple tasks while preserving result order
C#: Task.WhenAll returns results in the same order as the supplied tasks.
C#✓ Tested
Calculate whole days between dates
Subtract Julian day values for date-only inputs.
julianday✓ Tested
Capture a successful child-process result
Python: Run an argument list without a shell and check the return code.
Python✓ Tested
Check whether any selected element matches
jQuery: is returns a Boolean without changing the selection.
jQuery✓ Tested
Check whether every item matches
JavaScript: every stops at the first failed predicate and returns true for an empty array.
JavaScript✓ Tested