Results for “Sort-Object”
Small, practical examples. Search by task or narrow things down below.
Distinguish an own property from an inherited one
TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
TypeScript✓ Tested
Filter items in a pipeline
Keep numbers that meet a condition.
Where-Object✓ Tested
Find differences between two collections
PowerShell: Compare-Object marks reference-only values with a left arrow and difference-only values with a right arrow.
PowerShell✓ Tested
Find members absent from another set
JavaScript: Negate a membership test to calculate the set difference.
JavaScript✓ Tested
Find members absent from another set
TypeScript: Negate a membership test to calculate the set difference.
TypeScript✓ Tested
Find shared members of two sets
JavaScript: Filter one set through the other set’s membership test.
JavaScript✓ Tested
Find shared members of two sets
TypeScript: Filter one set through the other set’s membership test.
TypeScript✓ Tested
Fit an entire image inside a differently shaped box
CSS: Contain preserves the image aspect ratio while keeping all of it visible inside the specified content box.
CSS✓ Tested
Group records into map entries
JavaScript: Initialize an array for a missing Map key before appending its values.
JavaScript✓ Tested
Group records into map entries
TypeScript: Initialize an array for a missing Map key before appending its values.
TypeScript✓ Tested
Merge configuration maps with override precedence
PowerShell: Copy defaults before applying override keys so the original remains unchanged.
PowerShell✓ Tested
Place missing values after known values portably
SQL: A CASE sort key controls NULL placement without relying on engine-specific defaults.
SQL✓ Tested