FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
JavaScriptArray restructuring

Replace an array segment in place

JavaScript: splice returns removed items and inserts replacements at the chosen position.

JavaScript✓ Tested
JavaScriptGetting Started

Replace one collection element

JavaScript: Update an existing element at a known valid index.

JavaScript✓ Tested
Bash ScriptsGetting Started

Replace text with parameter expansion

Bash Scripts: Replace text with parameter expansion with a small standalone Bash program.

Bash Scripts✓ Tested
ReactAsync work & status

Report partial success from multiple actions

Report partial success from multiple actions with a small React component and explicit browser behavior.

React✓ Tested
JavaScriptGetting Started

Require two conditions to be true

JavaScript: Combine a lower and an upper bound to check whether a value is in range.

JavaScript✓ Tested
Bash ScriptsFunction scope & composition

Return a value through a named output variable

Bash Scripts: A Bash nameref can update a caller-supplied variable without command substitution.

Bash Scripts✓ Tested
Bash ScriptsFunction scope & composition

Return an array through a nameref

Bash Scripts: Assign through a nameref to preserve array element boundaries.

Bash Scripts✓ Tested
JavaScriptArray restructuring

Reverse a copy while preserving the original

JavaScript: Copy before reverse because reverse mutates the array it receives.

JavaScript✓ Tested
JavaScriptPromises & iteration protocols

Run cleanup after a promise settles

JavaScript: finally runs after success or failure and normally preserves the original outcome.

JavaScript✓ Tested
JavaScriptGetting Started

Run your first program

JavaScript: Start with a complete program that prints one line. Follow the run instructions below.

JavaScript✓ Tested
Bash ScriptsArray operations

Select a range of array elements

Bash Scripts: Quote a sliced at-sign expansion to keep each selected element separate.

Bash Scripts✓ 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