Results for “Hashtables & object records”
Small, practical examples. Search by task or narrow things down below.
Narrow an object using a type pattern
C#: A successful is pattern introduces a strongly typed local variable.
C#✓ Tested
Parse JSON into an object
Access a named field in a JSON document.
JSON✓ Tested
Pass an object to the style prop
Pass an object to the style prop with a small React component and explicit browser behavior.
React✓ Tested
Preserve equal-key order while sorting records
C++: stable_sort retains encounter order for records whose selected sort keys compare equal.
C++✓ Tested
Preserve input state when tracked records reorder
Preserve input state when tracked records reorder with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Read an object’s own enumerable values
JavaScript: Object.values provides values without their corresponding keys.
JavaScript✓ Tested
Read an object’s own enumerable values
TypeScript: Object.values provides values without their corresponding keys.
TypeScript✓ Tested
Reject unknown JSON object fields
Reject unknown JSON object fields using a complete Go program with explicit sample inputs.
Go✓ Tested
Remove duplicate records by a selected key
C#: DistinctBy keeps the first record for each key in encounter order.
C#✓ Tested
Replace an object signal immutably
Replace an object signal immutably with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Return a collection as one pipeline object
PowerShell: The unary comma prevents the returned array from being enumerated at this boundary.
PowerShell✓ Tested
Select object properties
Create a smaller object with only the fields you need.
Select-Object✓ Tested