Results for “Object behavior & collections”
Small, practical examples. Search by task or narrow things down below.
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
Replace an object signal immutably
Replace an object signal immutably with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Select object properties
Create a smaller object with only the fields you need.
Select-Object✓ Tested
Send query parameters as an object
jQuery: jQuery encodes the data object into the request query.
jQuery✓ Tested
Store an object associated with an element
jQuery: data retains JavaScript values without serializing them into HTML attributes.
jQuery✓ Tested
Update a nested object immutably
Update a nested object immutably with a small React component and explicit browser behavior.
React✓ Tested
Update an object without mutating state
Update an object without mutating state with a small React component and explicit browser behavior.
React✓ Tested
Accept a small behavior interface
Accept a small behavior interface using a complete Go program with explicit sample inputs.
Go✓ Tested
Attach behavior to a struct
Attach behavior to a struct using a complete Go program with explicit sample inputs.
Go✓ Tested
Check what kind of Git object a revision names
Git: cat-file -t distinguishes a commit, tree, blob, or annotated tag.
Git✓ Tested
Combine collections as a distinct set
C#: Union retains each value once across both inputs.
C#✓ Tested
Convert an object’s properties into a hashtable
PowerShell: Enumerate PSObject.Properties when the set of property names is known only at runtime.
PowerShell✓ Tested