FIND YOUR NEXT FEW LINES

Results for “from”

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

321 snippets foundClear filters
CStructures & function interfaces

Return a status separately from a calculated result

C: An output pointer lets a function return success or failure independently of its numeric result.

C✓ Tested
HTMLNative disclosure & dialogs

Return a value from a dialog form

HTML: A form with method dialog closes its containing dialog without a network submission.

HTML✓ Tested
RustGetting Started

Return a value from a loop

Return a value from a loop in a complete Rust program using the standard library.

Rust✓ Tested
JavaRecords & reliable control flow

Return a value from a switch expression

Java: Use an exhaustive switch expression with a fallback for other input values.

Java✓ Tested
C#Types & reliable control flow

Return multiple named values from a method

C#: Named value tuples give lightweight field names without a separate class.

C#✓ Tested
Bash ScriptsFunctions & arguments

Return text from a shell function

Capture a function’s output with command substitution.

function✓ Tested
GoGetting Started

Return two values from a function

Return two values from a function using a complete Go program with explicit sample inputs.

Go✓ Tested
TypeScriptUtilities & async

Return typed data from an async function

Await a Promise and handle failures explicitly.

async✓ Tested
C++Numeric parsing & calculations

Round halfway floating-point values away from zero

C++: std::round has an explicit halfway rule different from truncation.

C++✓ Tested
CSSResponsive conditions & sizing

Scale a value from the root font size

CSS: Rem units follow the document root instead of accumulating through nested font sizes.

CSS✓ Tested
jQueryTraversal & selection

Select a range from a collection

jQuery: slice includes the start index and excludes the end index.

jQuery✓ Tested
JavaScriptArray traversal & selection

Separate a first item from the remaining items

JavaScript: Array destructuring and a rest element produce named pieces of a sequence.

JavaScript✓ Tested