FIND YOUR NEXT FEW LINES

Results for “Array transformations”

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

179 snippets foundClear filters
PostgresJSON & arrays

Expand an array into rows

Use WITH ORDINALITY to retain original element order.

unnest✓ Tested
TypeScriptCollections & records

Filter and transform an array

Keep active objects and extract their names.

filter✓ Tested
CArrays

Find an array element

Use a bounded linear search over a C array.

C✓ Tested
JavaScriptArray traversal & selection

Find the first matching array item

JavaScript: find returns undefined when no item satisfies the predicate.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Find the first matching array item

TypeScript: find returns undefined when no item satisfies the predicate.

TypeScript✓ Tested
PowerShellArray operations

Find the index of an array item

PowerShell: Array.IndexOf returns -1 when the requested item is absent.

PowerShell✓ Tested
CArrays

Find the largest array value

Track the maximum in a nonempty C integer array.

C✓ Tested
CStructures & function interfaces

Iterate over a fixed array of records

C: Compute the array element count with sizeof at the point where it is still an array.

C✓ Tested
JavaScriptArray traversal & selection

Iterate with array indices and values

JavaScript: entries provides each position and value without a separate counter.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Iterate with array indices and values

TypeScript: entries provides each position and value without a separate counter.

TypeScript✓ Tested
PowerShellGetting Started

Join an array into text

PowerShell: Join an array into text using PowerShell 7.

PowerShell✓ Tested
Bash ScriptsArray operations

Join array items with a one-character separator

Bash Scripts: A local IFS controls the separator used by the quoted star expansion.

Bash Scripts✓ Tested