FIND YOUR NEXT FEW LINES

Results for “indexed access”

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

83 snippets foundClear filters
TypeScriptUtilities & async

Read a property with keyof

Keep the key and returned value tied to an object type.

keyof✓ Tested
HTMLImages & embedded documents

Allow embedded scripts without granting same-origin access

HTML: Grant only allow-scripts so the sandboxed document retains an opaque origin.

HTML✓ Tested
AngularGetting Started

Bind an accessibility attribute

Bind an accessibility attribute with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
HTMLImages & embedded documents

Exclude a purely decorative image from accessible content

HTML: An empty alt indicates that this image adds no information beyond nearby content.

HTML✓ Tested
HTMLAccessible structure

Give a section an accessible region name

HTML: A section becomes a named landmark when its heading is referenced with aria-labelledby.

HTML✓ Tested
HTMLImages & embedded documents

Give an inline SVG an accessible name

HTML: Use a title referenced by aria-labelledby for a meaningful inline vector image.

HTML✓ Tested
C#Asynchronous work & URI handling

Limit concurrent access with SemaphoreSlim

C#: Release the semaphore in finally so exceptions cannot leave it permanently acquired.

C#✓ Tested
Bash ScriptsArray operations

Remove an indexed element and compact the array

Bash Scripts: Unsetting an element leaves a gap; reassigning the values creates consecutive indices.

Bash Scripts✓ Tested
AngularAccessibility & reusable patterns

Render a table with accessible headers

Render a table with accessible headers with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactContext & shared state

Validate access through a custom context hook

Validate access through a custom context hook with a small React component and explicit browser behavior.

React✓ Tested
CSSVisual treatment & accessibility

Add depth with a box shadow

CSS: Box shadows are painted outside the box without reserving additional layout space.

CSS✓ Tested
CSSVisual treatment & accessibility

Align an image within its content box

CSS: Object-position places the rendered object when fitting leaves spare space or crops an edge.

CSS✓ Tested