FIND YOUR NEXT FEW LINES

Results for “Array transformations”

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

179 snippets foundClear filters
TypeScriptArray restructuring

Split an array into bounded batches

TypeScript: Advance by a positive batch size and allow a shorter final chunk.

TypeScript✓ Tested
PowerShellArray operations

Split an array into fixed-size batches

PowerShell: Bound the final index so the last batch can contain fewer elements.

PowerShell✓ 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
Arduino / CGetting Started

Store several readings in an array

Arduino / C: Store several readings in an array on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
CArrays

Sum array values

Iterate over a fixed C array using a size-derived element count.

C✓ Tested
PowerShellArray operations

Test whether an array contains a value

PowerShell: The contains operator compares complete items rather than matching substrings.

PowerShell✓ Tested
jQueryCollections & styling

Transform a collection into a plain array

jQuery: map followed by get returns ordinary JavaScript values.

jQuery✓ Tested
JavaScriptArrays

Transform array values

Use map to create a JavaScript array of squared values.

JavaScript✓ Tested
ReactState & reducers

Update one array item by its identifier

Update one array item by its identifier with a small React component and explicit browser behavior.

React✓ Tested
Bash ScriptsArray operations

Visit associative-array keys in a stable order

Bash Scripts: Associative arrays have no defined iteration order, so sort their keys explicitly.

Bash Scripts✓ Tested
Arduino / CGetting Started

Visit every reading in a fixed array

Arduino / C: Visit every reading in a fixed array on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
RustIterators & transformations

Accumulate a result with fold

Accumulate a result with fold in a complete Rust program using the standard library.

Rust✓ Tested