Results for “associative array”
Small, practical examples. Search by task or narrow things down below.
Create independent rows in a matrix
TypeScript: Use a mapping function to create each row instead of sharing one array with fill.
TypeScript✓ Tested
Dispatch a command through function pointers
Arduino / C: A small function table can map validated command indices to actions.
Arduino / C✓ Tested
Expose immutable collection operations
Expose immutable collection operations with a small React component and explicit browser behavior.
React✓ Tested
Find a sample range in one pass
Arduino / C: Initialize extrema from the first element of a nonempty array.
Arduino / C✓ Tested
Find a value in a small lookup table
Arduino / C: A linear scan is simple and predictable for a small fixed array.
Arduino / C✓ Tested
Find the position of a matching item
JavaScript: findIndex returns -1 when the predicate matches nothing.
JavaScript✓ Tested
Find the position of a matching item
TypeScript: findIndex returns -1 when the predicate matches nothing.
TypeScript✓ Tested
Flatten a single nesting level
JavaScript: flat defaults to a depth of one and creates a new array.
JavaScript✓ Tested
Flatten a single nesting level
TypeScript: flat defaults to a depth of one and creates a new array.
TypeScript✓ Tested
Generate a bounded integer range
JavaScript: Array.from supplies each output position to its mapping function.
JavaScript✓ Tested
Generate a bounded integer range
TypeScript: Array.from supplies each output position to its mapping function.
TypeScript✓ Tested
Group related readings in a struct
Arduino / C: A struct keeps a sample’s fields together without dynamic allocation.
Arduino / C✓ Tested