Results for “cr”
Small, practical examples. Search by task or narrow things down below.
Check whether text ends with a suffix
JavaScript: Use endsWith for a literal case-sensitive ending.
JavaScript✓ Tested
Check whether text ends with a suffix
TypeScript: Use endsWith for a literal case-sensitive ending.
TypeScript✓ Tested
Check whether text starts with a prefix
JavaScript: Use startsWith for a literal case-sensitive prefix comparison.
JavaScript✓ Tested
Check whether text starts with a prefix
TypeScript: Use startsWith for a literal case-sensitive prefix comparison.
TypeScript✓ Tested
Choose among several numeric ranges
Bash Scripts: An if-elif chain evaluates branches in order and executes the first match.
Bash Scripts✓ Tested
Choose an action with case
Bash Scripts: Choose an action with case with a small standalone Bash program.
Bash Scripts✓ Tested
Choose between two branches
JavaScript: Use if and else to handle an available or empty stock count.
JavaScript✓ Tested
Choose between two branches
TypeScript: Use if and else to handle an available or empty stock count.
TypeScript✓ Tested
Clamp a number between inclusive bounds
JavaScript: Combine Math.min and Math.max when lower is no greater than upper.
JavaScript✓ 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 numeric setting to a valid range
Bash Scripts: Use arithmetic comparisons before applying a user-supplied bounded setting.
Bash Scripts✓ Tested
Classify a filename with shell patterns
Bash Scripts: Case patterns support alternatives without launching an external regex tool.
Bash Scripts✓ Tested