FIND YOUR NEXT FEW LINES

Results for “script”

Small, practical examples. Search by task or narrow things down below.

407 snippets foundClear filters
TypeScriptNumbers & numeric validation

Calculate integers beyond Number’s precise range

TypeScript: Use BigInt operands together to avoid precision loss.

TypeScript✓ Tested
Bash ScriptsGetting Started

Calculate with integer arithmetic

Bash Scripts: Calculate with integer arithmetic with a small standalone Bash program.

Bash Scripts✓ Tested
JavaScriptGetting Started

Call a library function

JavaScript: Use a standard absolute-value function with a small negative number.

JavaScript✓ Tested
TypeScriptGetting Started

Call a library function

TypeScript: Use a standard absolute-value function with a small negative number.

TypeScript✓ Tested
Bash ScriptsGetting Started

Capture a command’s output

Bash Scripts: Capture a command’s output with a small standalone Bash program.

Bash Scripts✓ Tested
Bash ScriptsFunction scope & composition

Capture output while handling a failed command

Bash Scripts: An assignment inherits the status of its command substitution, allowing both output and status to be handled.

Bash Scripts✓ Tested
Bash ScriptsInput streams & redirection

Capture standard output and standard error separately

Bash Scripts: Use distinct redirections when diagnostic text should not be mixed with data.

Bash Scripts✓ Tested
Bash ScriptsProcesses & environment

Change directory only for one operation

Bash Scripts: A subshell makes a temporary directory change without affecting later commands.

Bash Scripts✓ Tested
JavaScriptArray traversal & selection

Check array membership with includes

JavaScript: includes uses SameValueZero comparison, which also matches NaN.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Check array membership with includes

TypeScript: includes uses SameValueZero comparison, which also matches NaN.

TypeScript✓ Tested
Bash ScriptsArray operations

Check exact array membership

Bash Scripts: Compare each element literally instead of searching a concatenated string.

Bash Scripts✓ Tested
JavaScriptStrings

Check for a substring

Perform a case-sensitive JavaScript substring check.

JavaScript✓ Tested