Results for “properties”
Small, practical examples. Search by task or narrow things down below.
Construct a record with named properties
PowerShell: PSCustomObject gives downstream pipeline commands meaningful property names.
PowerShell✓ 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
Create an object with named properties
PowerShell: Create an object with named properties using PowerShell 7.
PowerShell✓ Tested
Inspect a URI through typed properties
PowerShell: The Uri class separates URL components without manual string splitting.
PowerShell✓ Tested
Load a small properties configuration
Java: Use a Reader to make the configuration character encoding explicit.
Java✓ Tested
Prevent runtime changes to top-level properties
JavaScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.
JavaScript✓ Tested
Prevent runtime changes to top-level properties
TypeScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.
TypeScript✓ Tested
Reuse colors with custom properties
Define a CSS custom property and use it for text color.
CSS✓ Tested
Select object properties
Create a smaller object with only the fields you need.
Select-Object✓ Tested
Select fields with the Pick utility type
Expose a smaller view of a larger object type.
Pick✓ Tested
Add a calculated property during selection
PowerShell: A calculated property can derive a value while retaining selected original properties.
PowerShell✓ Tested
Animate a numeric CSS property
jQuery: animate interpolates supported numeric properties to their final values.
jQuery✓ Tested