FIND YOUR NEXT FEW LINES

Results for “script”

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

407 snippets foundClear filters
TypeScriptGetting Started

Convert known numeric text to an integer

TypeScript: Convert a trusted literal to an integer before adding. Validate external input before converting it.

TypeScript✓ Tested
JavaScriptArray traversal & selection

Copy a range without changing the source

JavaScript: Array.slice returns a shallow copy of the selected half-open range.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Copy a range without changing the source

TypeScript: Array.slice returns a shallow copy of the selected half-open range.

TypeScript✓ Tested
Bash ScriptsArray operations

Copy an array independently

Bash Scripts: A new array assignment copies element values rather than creating a shared reference.

Bash Scripts✓ Tested
JavaScriptObject behavior & collections

Copy nested structured data independently

JavaScript: structuredClone creates an independent copy of supported structured values.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Copy nested structured data independently

TypeScript: structuredClone creates an independent copy of supported structured values.

TypeScript✓ Tested
Bash ScriptsGetting Started

Count array elements

Bash Scripts: Count array elements with a small standalone Bash program.

Bash Scripts✓ Tested
JavaScriptUTC date operations

Count days between UTC-midnight dates

JavaScript: A day is exactly 86400000 milliseconds for these explicitly UTC-midnight inputs.

JavaScript✓ Tested
TypeScriptUTC date operations

Count days between UTC-midnight dates

TypeScript: A day is exactly 86400000 milliseconds for these explicitly UTC-midnight inputs.

TypeScript✓ Tested
Bash ScriptsGetting Started

Count down with a while loop

Bash Scripts: Count down with a while loop with a small standalone Bash program.

Bash Scripts✓ Tested
Bash ScriptsArray operations

Count the elements in an array

Bash Scripts: The array length form counts assigned elements, not characters in the first value.

Bash Scripts✓ Tested
JavaScriptGetting Started

Count the items in a collection

JavaScript: Read the collection’s length instead of hard-coding the loop limit.

JavaScript✓ Tested