Results for “then”
Small, practical examples. Search by task or narrow things down below.
Choose an image’s default directory
Docker / Compose: Choose an image’s default directory with a complete introductory Dockerfile.
Docker / Compose✓ Tested
Choose Bash with pipefail for build commands
Docker / Compose: SHELL changes the interpreter for subsequent shell-form instructions.
Docker / Compose✓ Tested
Choose between two branches
TypeScript: Use if and else to handle an available or empty stock count.
TypeScript✓ Tested
Choose between two branches
C++: Use if and else to handle an available or empty stock count.
C++✓ Tested
Choose between two branches
C: Use if and else to handle an available or empty stock count.
C✓ Tested
Choose floating-point arithmetic
Choose floating-point arithmetic in a complete Rust program using the standard library.
Rust✓ Tested
Choose template content with @switch
Choose template content with @switch with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Clamp a number between inclusive bounds
TypeScript: Combine Math.min and Math.max when lower is no greater than upper.
TypeScript✓ Tested
Clamp a number to a valid interval
Clamp a number to a valid interval in a complete Rust program using the standard library.
Rust✓ Tested
Clamp a value to a range
Use C++17 clamp to bound a numeric value.
C++✓ Tested
Clamp an integer to inclusive bounds
C: Explicit comparisons avoid relying on nonstandard min or max macros.
C✓ Tested
Clean up a generator after an early break
TypeScript: Breaking a for-of loop closes a generator and runs its finally block.
TypeScript✓ Tested