Results for “if”
Small, practical examples. Search by task or narrow things down below.
Size a child relative to its containing block
CSS: A percentage width is based on the containing block’s available width.
CSS✓ Tested
Size a panel relative to viewport height
CSS: Viewport height units track the browser viewport rather than the parent element.
CSS✓ Tested
Sort dictionaries by a value
Sort a list of dictionaries by a numeric field, leaving the original list unchanged.
sort✓ Tested
Sort preferred rows ahead of other rows
SQL: A CASE ordering key expresses business priority before a stable secondary sort.
SQL✓ Tested
Sort preferred rows ahead of other rows
SQL Server: A CASE ordering key expresses business priority before a stable secondary sort.
SQL Server✓ Tested
Sort preferred rows ahead of other rows
Postgres: A CASE ordering key expresses business priority before a stable secondary sort.
Postgres✓ Tested
Sort preferred rows ahead of other rows
SQLite: A CASE ordering key expresses business priority before a stable secondary sort.
SQLite✓ Tested
Sort the highest quantities first
SQL: Specify descending order and a stable tie breaker.
SQL✓ Tested
Sort the highest quantities first
SQL Server: Specify descending order and a stable tie breaker.
SQL Server✓ Tested
Sort the highest quantities first
Postgres: Specify descending order and a stable tie breaker.
Postgres✓ Tested
Sort the highest quantities first
SQLite: Specify descending order and a stable tie breaker.
SQLite✓ Tested
Sort timestamp strings by their parsed instants
JavaScript: Compare epoch values explicitly when date strings may contain different offsets.
JavaScript✓ Tested