FIND YOUR NEXT FEW LINES

Results for “for”

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

3000 snippets foundClear filters
TypeScriptUTC date operations

Construct a date from Unix seconds

TypeScript: Multiply seconds by 1000 before creating a Date.

TypeScript✓ Tested
RustGetting Started

Construct a named-field struct

Construct a named-field struct in a complete Rust program using the standard library.

Rust✓ Tested
PowerShellHashtables & object records

Construct a record with named properties

PowerShell: PSCustomObject gives downstream pipeline commands meaningful property names.

PowerShell✓ Tested
RustFunctions & data types

Construct a struct with default values

Construct a struct with default values in a complete Rust program using the standard library.

Rust✓ Tested
RustNumbers & durations

Construct an instant relative to the Unix epoch

Construct an instant relative to the Unix epoch in a complete Rust program using the standard library.

Rust✓ Tested
JavaScriptPromises & iteration protocols

Consume an asynchronous sequence

JavaScript: for await waits for each value of an async iterator in sequence.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Consume an asynchronous sequence

TypeScript: for await waits for each value of an async iterator in sequence.

TypeScript✓ Tested
Bash ScriptsArguments & decisions

Consume positional arguments one at a time

Bash Scripts: Check the argument count before accessing the first parameter with nounset enabled.

Bash Scripts✓ Tested
HTMLTables & list numbering

Continue an ordered list at a chosen number

HTML: The start attribute controls the initial ordinal without changing item text.

HTML✓ Tested
ReactGetting Started

Control a checkbox

Control a checkbox with a small React component and explicit browser behavior.

React✓ Tested
ReactForms & validation

Control a multiline text field

Control a multiline text field with a small React component and explicit browser behavior.

React✓ Tested
AngularEvents & DOM interaction

Control a native dialog through a reference

Control a native dialog through a reference with a standalone Angular component and explicit browser behavior.

Angular✓ Tested