Results for “as”
Small, practical examples. Search by task or narrow things down below.
Choose between two script branches
Bash Scripts: Choose between two script branches with a small standalone Bash program.
Bash Scripts✓ 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 numeric setting to a valid range
Bash Scripts: Use arithmetic comparisons before applying a user-supplied bounded setting.
Bash Scripts✓ Tested
Clean up a generator after an early break
JavaScript: Breaking a for-of loop closes a generator and runs its finally block.
JavaScript✓ Tested
Collect two independent background results
Bash Scripts: Write each job’s output separately and wait for both before combining results.
Bash Scripts✓ Tested
Combine a branch’s changes into one new commit
Git: Squash prepares the combined changes in the index without recording a merge parent.
Git✓ Tested
Combine text with a name
JavaScript: Construct a greeting from a fixed prefix and a stored name.
JavaScript✓ Tested
Compare a value literally inside a conditional
Bash Scripts: Quoting the right side of an equality test makes wildcard characters literal.
Bash Scripts✓ Tested
Compare a value with a limit
JavaScript: Turn a comparison into a readable yes or no result.
JavaScript✓ Tested
Compare bounded floating-point results with a tolerance
JavaScript: Use an absolute error threshold for values known to be near one.
JavaScript✓ Tested
Compare canonically equivalent Unicode text
JavaScript: Normalize to NFC before comparing equivalent composed and decomposed text.
JavaScript✓ Tested
Compare two generated sorted streams
Bash Scripts: Process substitution lets a command consume another command’s output as a file-like input.
Bash Scripts✓ Tested