FIND YOUR NEXT FEW LINES

Results for “Functions & data types”

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

787 snippets foundClear filters
PowerShellFunctions & parameter validation

Enforce a numeric range at a function boundary

PowerShell: ValidateRange performs argument validation before work begins.

PowerShell✓ Tested
TypeScriptGetting Started

Explain a calculation with a comment

TypeScript: Keep the code executable while documenting why a fixed input is used.

TypeScript✓ Tested
TypeScriptRegular expressions & URL encoding

Extract all regex matches with their groups

TypeScript: matchAll requires a global regular expression and returns an iterator of matches.

TypeScript✓ Tested
TypeScriptText handling & Unicode

Extract text by start and end positions

TypeScript: String slice uses an inclusive start and exclusive end measured in UTF-16 code units.

TypeScript✓ Tested
TypeScriptText handling & Unicode

Extract the text after the last delimiter

TypeScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.

TypeScript✓ Tested
AngularLifecycle & observable data

Filter observable emissions

Filter observable emissions with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
TypeScriptObject behavior & collections

Find members absent from another set

TypeScript: Negate a membership test to calculate the set difference.

TypeScript✓ Tested
SQLRelationships & missing data

Find parents whose every child meets a rule

SQL: Combine existence with the absence of a violating child to exclude parents with no children.

SQL✓ Tested
SQL ServerRelationships & missing data

Find parents whose every child meets a rule

SQL Server: Combine existence with the absence of a violating child to exclude parents with no children.

SQL Server✓ Tested
PostgresRelationships & missing data

Find parents whose every child meets a rule

Postgres: Combine existence with the absence of a violating child to exclude parents with no children.

Postgres✓ Tested
SQLiteRelationships & missing data

Find parents whose every child meets a rule

SQLite: Combine existence with the absence of a violating child to exclude parents with no children.

SQLite✓ Tested
SQLRelationships & missing data

Find parents with at least two child rows

SQL: Use a correlated count when testing a per-parent threshold.

SQL✓ Tested