Results for “Hashtables & object records”
Small, practical examples. Search by task or narrow things down below.
Find records without any related rows
SQL: NOT EXISTS avoids the NULL pitfalls of NOT IN when the subquery column can be missing.
SQL✓ Tested
Find records without any related rows
SQL Server: NOT EXISTS avoids the NULL pitfalls of NOT IN when the subquery column can be missing.
SQL Server✓ Tested
Find records without any related rows
Postgres: NOT EXISTS avoids the NULL pitfalls of NOT IN when the subquery column can be missing.
Postgres✓ Tested
Find records without any related rows
SQLite: NOT EXISTS avoids the NULL pitfalls of NOT IN when the subquery column can be missing.
SQLite✓ Tested
Group records by a field
Python: Accumulate related values with defaultdict without checking whether each group exists.
Python✓ Tested
Index records by a unique key
Java: Use toMap with an explicit merge rule so duplicate keys have defined behavior.
Java✓ Tested
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
Iterate over object entries
Read JavaScript property names and values using Object.entries.
JavaScript✓ Tested
List an object’s own enumerable keys
JavaScript: Object.keys omits inherited and non-enumerable properties.
JavaScript✓ Tested
List an object’s own enumerable keys
TypeScript: Object.keys omits inherited and non-enumerable properties.
TypeScript✓ Tested
Memoize an object passed to a provider
Memoize an object passed to a provider with a small React component and explicit browser behavior.
React✓ Tested
Merge object settings
Use object spread to apply JavaScript overrides to defaults.
JavaScript✓ Tested