Results for “as”
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
Prepend items while preserving existing array values
Bash Scripts: Construct a new array with the new values before the quoted original expansion.
Bash Scripts✓ Tested
Preserve a failure status while an EXIT trap runs
Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.
Bash Scripts✓ 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
Print a number with two decimal places
JavaScript: Format a small decimal value consistently for display.
JavaScript✓ Tested
Print text containing percent characters literally
Bash Scripts: Never use untrusted text as the printf format string.
Bash Scripts✓ Tested
Produce a lazy sequence with a generator
JavaScript: A generator yields one value per iteration without building an intermediate array.
JavaScript✓ Tested
Protect a shared container with a mutex
C++: A scoped lock_guard releases the mutex when its scope ends.
C++✓ Tested
Read a nested value safely
Combine optional chaining with nullish coalescing in JavaScript.
JavaScript✓ Tested