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
TypeScriptGetting Started

Read one character from ASCII text

TypeScript: Use a valid zero-based index to read the first character.

TypeScript✓ Tested
PythonStructured data & serialization

Read one JSON document per line

Python: Parse nonempty JSON Lines records independently instead of loading a JSON array.

Python✓ Tested
TypeScriptGetting Started

Read the beginning of a text value

TypeScript: Extract or display the first three ASCII characters from a known nonempty string.

TypeScript✓ Tested
TypeScriptArray traversal & selection

Read the final array item with a negative index

TypeScript: at supports negative positions counted from the end.

TypeScript✓ Tested
TypeScriptGetting Started

Read the first collection element

TypeScript: Access index zero only after establishing that the collection is nonempty.

TypeScript✓ Tested
TypeScriptPromises & iteration protocols

Recover from an expected promise rejection

TypeScript: Return a fallback from catch so later handlers receive an ordinary resolved value.

TypeScript✓ Tested
AngularLifecycle & observable data

Register cleanup through DestroyRef

Register cleanup through DestroyRef with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
TypeScriptObject behavior & collections

Remove a Map entry and detect whether it existed

TypeScript: Map.delete returns true only when an entry was present.

TypeScript✓ Tested
C#Collections & data structures

Remove matching items from a mutable list

C#: List.RemoveAll returns how many items it removed.

C#✓ Tested
Docker / ComposeNetworks & volume metadata

Remove one network attachment

Docker / Compose: network disconnect removes the specified attachment while retaining the container.

Docker / Compose✓ Tested
AngularLifecycle & observable data

Render an observable with AsyncPipe

Render an observable with AsyncPipe with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
TypeScriptRegular expressions & URL encoding

Reorder captured text in a replacement

TypeScript: Use numbered replacement groups to rearrange a known two-part name.

TypeScript✓ Tested