FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
Bash ScriptsArguments & decisions

Stop a search loop at the first match

Bash Scripts: Break exits the current loop as soon as the desired item is found.

Bash Scripts✓ Tested
JavaScriptGetting Started

Store a value in a named variable

JavaScript: Give a value a descriptive name and print it.

JavaScript✓ Tested
Bash ScriptsGetting Started

Store and iterate over an array

Bash Scripts: Store and iterate over an array with a small standalone Bash program.

Bash Scripts✓ Tested
Bash ScriptsGetting Started

Store text in a variable

Bash Scripts: Store text in a variable with a small standalone Bash program.

Bash Scripts✓ Tested
Bash ScriptsInput streams & redirection

Substitute values into a multiline template

Bash Scripts: An unquoted heredoc delimiter enables parameter expansion in the template.

Bash Scripts✓ Tested
PowerShellCollections & objects

Sum a collection

Calculate a total with Measure-Object.

Measure-Object✓ Tested
JavaScriptArrays

Sum numeric values

Provide an initial accumulator for JavaScript reduce, including empty arrays.

JavaScript✓ Tested
GitBranches & recovery

Temporarily store tracked-file edits

Restore a clean working tree and then reapply your saved changes.

stash✓ Tested
Bash ScriptsGetting Started

Test a function’s success status

Bash Scripts: Test a function’s success status with a small standalone Bash program.

Bash Scripts✓ Tested
Bash ScriptsText parsing & arithmetic

Test numeric divisibility with a remainder

Bash Scripts: The modulo operator computes an integer remainder.

Bash Scripts✓ Tested
JavaScriptPromises & iteration protocols

Transform a resolved promise result

JavaScript: A then handler returns the value passed to the next promise in the chain.

JavaScript✓ Tested
JavaScriptArrays

Transform array values

Use map to create a JavaScript array of squared values.

JavaScript✓ Tested