Results for “Types & reliable control flow”
Small, practical examples. Search by task or narrow things down below.
Place missing values after known values portably
SQL: A CASE sort key controls NULL placement without relying on engine-specific defaults.
SQL✓ Tested
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
Prevent an item from shrinking
CSS: Flex-shrink zero preserves a required size even when the container overflows.
CSS✓ Tested
Read a nested optional value
Avoid dereferencing a missing nested object.
optional chaining✓ Tested
Read a property with keyof
Keep the key and returned value tied to an object type.
keyof✓ Tested
Reject a missing required configuration value
Bash Scripts: Check a required value explicitly and emit a controlled diagnostic before exiting.
Bash Scripts✓ Tested
Remove duplicate values with a Set
Keep the first occurrence order while deduplicating.
Set✓ Tested
Repeat an action a fixed number of times
Use a counter and delay for a simple finite sequence.
for loop✓ Tested
Require a checkbox to be selected
HTML: A required checkbox is invalid until that individual control is checked.
HTML✓ Tested
Require a nonempty text value
HTML: The required attribute makes an empty text control fail native constraint validation.
HTML✓ Tested