FIND YOUR NEXT FEW LINES

Results for “Array transformations”

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

179 snippets foundClear filters
Arduino / CArrays & embedded state

Use named states for a controller

Arduino / C: An enum makes state transitions easier to read than unexplained numbers.

Arduino / C✓ Tested
PostgresJSON & arrays

Check JSONB containment

Test whether an object contains a key-value pair.

jsonb✓ Tested
CArrays

Count matching values

Count even numbers in a fixed C array.

C✓ Tested
JavaScriptArrays

Filter even numbers

Create a JavaScript array containing only even values.

JavaScript✓ Tested
JavaScriptObject behavior & collections

Group records into map entries

JavaScript: Initialize an array for a missing Map key before appending its values.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Group records into map entries

TypeScript: Initialize an array for a missing Map key before appending its values.

TypeScript✓ Tested
Bash ScriptsFiles & reliability

Handle a filename pattern with no matches

Use nullglob so an unmatched pattern produces an empty array.

nullglob✓ Tested
jQueryEvent control

Pass values through a custom event

jQuery: trigger passes its extra argument array after the event object.

jQuery✓ Tested
JavaScriptPromises & iteration protocols

Produce a lazy sequence with a generator

JavaScript: A generator yields one value per iteration without building an intermediate array.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Produce a lazy sequence with a generator

TypeScript: A generator yields one value per iteration without building an intermediate array.

TypeScript✓ Tested
PostgresJSON & arrays

Read a JSONB field as text

Extract a nested value from a JSON document.

jsonb✓ Tested
SQL ServerJSON & results

Read a scalar JSON property

Extract a named value using a JSON path.

JSON_VALUE✓ Tested