Results for “cr”
Small, practical examples. Search by task or narrow things down below.
Name a value that stays fixed
TypeScript: Use a constant declaration or the language’s constant naming convention for a fixed limit.
TypeScript✓ Tested
Normalize identifier case consistently
JavaScript: Use toLowerCase for a simple case-insensitive ASCII identifier lookup.
JavaScript✓ Tested
Normalize identifier case consistently
TypeScript: Use toLowerCase for a simple case-insensitive ASCII identifier lookup.
TypeScript✓ Tested
Observe command substitution’s trailing-newline removal
Bash Scripts: Command substitution removes trailing newlines while preserving embedded ones.
Bash Scripts✓ Tested
Pad a numeric label
Convert a number to text and pad it to a fixed width.
JavaScript✓ Tested
Pair corresponding array items by position
JavaScript: Validate equal lengths before zipping when missing counterparts would be an error.
JavaScript✓ Tested
Pair corresponding array items by position
TypeScript: Validate equal lengths before zipping when missing counterparts would be an error.
TypeScript✓ Tested
Parse a small set of long options
Bash Scripts: Use a loop and case statement to consume a value-bearing long option.
Bash Scripts✓ Tested
Parse digits with leading zeroes as decimal
Bash Scripts: The 10# prefix avoids Bash treating a leading zero as an octal notation.
Bash Scripts✓ Tested
Parse JSON text
Read a JavaScript object from JSON text.
JavaScript✓ Tested
Pass a block of behavior as an argument
PowerShell: Invoke a scriptblock with the call operator and an explicit input value.
PowerShell✓ Tested
Pass a variable to standard input
Bash Scripts: A here-string supplies the expanded value followed by a newline.
Bash Scripts✓ Tested