FIND YOUR NEXT FEW LINES

Results for “associative array”

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

152 snippets foundClear filters
JavaScriptArray traversal & selection

Check array membership with includes

JavaScript: includes uses SameValueZero comparison, which also matches NaN.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Check array membership with includes

TypeScript: includes uses SameValueZero comparison, which also matches NaN.

TypeScript✓ Tested
Bash ScriptsArray operations

Check exact array membership

Bash Scripts: Compare each element literally instead of searching a concatenated string.

Bash Scripts✓ Tested
PostgresJSON & arrays

Collect ordered values into an array

Build a sorted array from query rows.

array_agg✓ Tested
JavaScriptArray restructuring

Concatenate arrays without mutating either input

JavaScript: concat creates a shallow combined sequence.

JavaScript✓ Tested
TypeScriptArray restructuring

Concatenate arrays without mutating either input

TypeScript: concat creates a shallow combined sequence.

TypeScript✓ Tested
Bash ScriptsArray operations

Copy an array independently

Bash Scripts: A new array assignment copies element values rather than creating a shared reference.

Bash Scripts✓ Tested
Bash ScriptsGetting Started

Count array elements

Bash Scripts: Count array elements with a small standalone Bash program.

Bash Scripts✓ Tested
PowerShellGetting Started

Count array elements

PowerShell: Count array elements using PowerShell 7.

PowerShell✓ Tested
Bash ScriptsArray operations

Count the elements in an array

Bash Scripts: The array length form counts assigned elements, not characters in the first value.

Bash Scripts✓ Tested
RustGetting Started

Create a fixed-size array

Create a fixed-size array in a complete Rust program using the standard library.

Rust✓ Tested
PowerShellGetting Started

Create an array of text values

PowerShell: Create an array of text values using PowerShell 7.

PowerShell✓ Tested