Results for “Arrays & embedded state”
Small, practical examples. Search by task or narrow things down below.
Apply classes from explicit Boolean state
jQuery: The second toggleClass argument applies a known state consistently.
jQuery✓ Tested
Assign a bit from a Boolean state
Arduino / C: bitWrite accepts a bit position and a zero or nonzero value.
Arduino / C✓ Tested
Block scripts in an embedded document
HTML: An empty sandbox attribute applies the default set of restrictions, including blocking script execution.
HTML✓ Tested
Calculate derived state during rendering
Calculate derived state during rendering with a small React component and explicit browser behavior.
React✓ Tested
Capture state in a closure
Capture state in a closure using a complete Go program with explicit sample inputs.
Go✓ Tested
Centralize state changes in a reducer
Centralize state changes in a reducer with a small React component and explicit browser behavior.
React✓ Tested
Concatenate arrays without mutating either input
JavaScript: concat creates a shallow combined sequence.
JavaScript✓ Tested
Concatenate arrays without mutating either input
TypeScript: concat creates a shallow combined sequence.
TypeScript✓ Tested
Distinguish current state from initial markup
jQuery: prop reads the live checked state; attr reads the original checked attribute.
jQuery✓ Tested
Expose a disclosure button’s expanded state
HTML: Keep aria-expanded synchronized with the controlled panel’s hidden state.
HTML✓ Tested
Expose a disclosure’s expanded state
Expose a disclosure’s expanded state with a small React component and explicit browser behavior.
React✓ Tested
Expose a disclosure’s expanded state
Expose a disclosure’s expanded state with a standalone Angular component and explicit browser behavior.
Angular✓ Tested