FIND YOUR NEXT FEW LINES

Results for “Function scope & composition”

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

137 snippets foundClear filters
PowerShellFunctions & control

Choose an action with switch

Map a small command value to a result.

switch✓ Tested
C++Text validation & parsing

Convert ASCII text to lowercase safely

C++: Cast each byte to unsigned char before using the cctype function.

C++✓ Tested
CBinary formats & structured parsing

Convert ASCII text to lowercase safely

C: Cast to unsigned char before calling ctype functions on a possibly signed char.

C✓ Tested
Arduino / CSerial protocols

Convert received ASCII letters to uppercase

Arduino / C: ctype functions should receive an unsigned character value.

Arduino / C✓ Tested
JavaScriptArray restructuring

Create independent rows in a matrix

JavaScript: Use a mapping function to create each row instead of sharing one array with fill.

JavaScript✓ Tested
TypeScriptArray restructuring

Create independent rows in a matrix

TypeScript: Use a mapping function to create each row instead of sharing one array with fill.

TypeScript✓ Tested
JavaScriptPromises & iteration protocols

Delegate iteration to another iterable

JavaScript: yield-star forwards items from another iterable while retaining generator composition.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Delegate iteration to another iterable

TypeScript: yield-star forwards items from another iterable while retaining generator composition.

TypeScript✓ Tested
TypeScriptTypes & functions

Describe an object with an interface

Require named fields on a reusable object shape.

interface✓ Tested
PowerShellCommands & execution context

Discard incidental output from a setup command

PowerShell: Out-Null prevents setup objects from becoming part of a function or script’s useful result.

PowerShell✓ Tested
SQLiteJSON data

Expand a JSON array into rows

Iterate array elements using a table-valued function.

json_each✓ Tested
JavaScriptArray restructuring

Generate a bounded integer range

JavaScript: Array.from supplies each output position to its mapping function.

JavaScript✓ Tested