Results for “Sort-Object”
Small, practical examples. Search by task or narrow things down below.
Place missing values after known values portably
SQL Server: A CASE sort key controls NULL placement without relying on engine-specific defaults.
SQL Server✓ Tested
Place missing values after known values portably
Postgres: A CASE sort key controls NULL placement without relying on engine-specific defaults.
Postgres✓ Tested
Place missing values after known values portably
SQLite: A CASE sort key controls NULL placement without relying on engine-specific defaults.
SQLite✓ Tested
Preserve key insertion order
PowerShell: An ordered dictionary enumerates keys in the order they were inserted.
PowerShell✓ 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
Print only duplicate values
Linux Commands: Use uniq -d after sorting to report each repeated value once.
Linux Commands✓ Tested
Read a nested optional value
Avoid dereferencing a missing nested object.
optional chaining✓ Tested
Remove a Map entry and detect whether it existed
JavaScript: Map.delete returns true only when an entry was present.
JavaScript✓ Tested
Remove a Map entry and detect whether it existed
TypeScript: Map.delete returns true only when an entry was present.
TypeScript✓ Tested
Remove an optional hashtable entry
PowerShell: Remove changes the map in place without changing unrelated entries.
PowerShell✓ Tested
Set several inline styles together
jQuery: Pass a property-value object to css.
jQuery✓ Tested