FIND YOUR NEXT FEW LINES

Results for “od”

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

740 snippets foundClear filters
TypeScriptGetting Started

Read the first collection element

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

TypeScript✓ Tested
JavaScriptPromises & iteration protocols

Recover from an expected promise rejection

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

JavaScript✓ 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
AngularLists & control flow

Remove a list item by identifier

Remove a list item by identifier with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
JavaScriptObject behavior & collections

Remove a Map entry and detect whether it existed

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

JavaScript✓ 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
HTMLAccessible structure

Remove an inactive section from keyboard navigation

HTML: Inert prevents interaction and accessibility exposure for an inactive subtree.

HTML✓ Tested
JavaScriptArrays

Remove duplicate values

Use a JavaScript Set to preserve the first occurrence of each primitive value.

JavaScript✓ Tested
TypeScriptCollections & records

Remove duplicate values with a Set

Keep the first occurrence order while deduplicating.

Set✓ Tested
AngularGetting Started

Render a child standalone component

Render a child standalone component with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularGetting Started

Render a conditional branch with @if

Render a conditional branch with @if with a standalone Angular component and explicit browser behavior.

Angular✓ Tested