FIND YOUR NEXT FEW LINES

Results for “Object behavior & collections”

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

631 snippets foundClear filters
TypeScriptCollections & records

Type a dictionary with Record

Limit a lookup table to a known set of keys.

Record✓ Tested
AngularSignals & state

Update a signal from its previous value

Update a signal from its previous value with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactState & reducers

Update one array item by its identifier

Update one array item by its identifier with a small React component and explicit browser behavior.

React✓ Tested
ReactEffects & lifecycle

Update repeatedly with a cleaned-up interval

Update repeatedly with a cleaned-up interval with a small React component and explicit browser behavior.

React✓ Tested
ReactGetting Started

Update state from its previous value

Update state from its previous value with a small React component and explicit browser behavior.

React✓ Tested
ReactContext & shared state

Update state shared through context

Update state shared through context with a small React component and explicit browser behavior.

React✓ Tested
ReactContext & shared state

Use a context’s fallback value

Use a context’s fallback value with a small React component and explicit browser behavior.

React✓ Tested
JavaQueues & collection operations

Use a deque as a stack

Java: Use push and pop for last-in, first-out behavior.

Java✓ Tested
HTMLGetting Started

Use headings to show document structure

HTML: Learn how to use headings to show document structure in a complete browser example.

HTML✓ Tested
ReactForms & validation

Use native required-field validation

Use native required-field validation with a small React component and explicit browser behavior.

React✓ Tested
ReactContext & shared state

Use React 19’s provider shorthand

Use React 19’s provider shorthand with a small React component and explicit browser behavior.

React✓ Tested
HTMLGetting Started

Use semantic page landmarks

HTML: Learn how to use semantic page landmarks in a complete browser example.

HTML✓ Tested