Results for “item”
Small, practical examples. Search by task or narrow things down below.
Number items while iterating
Python: Use enumerate to attach a one-based position without maintaining a separate counter.
Python✓ Tested
Number items while iterating
Number items while iterating in a complete Rust program using the standard library.
Rust✓ Tested
Override cross-axis alignment for one item
CSS: Align-self changes one item without changing its siblings’ alignment.
CSS✓ Tested
Pair corresponding array items by position
JavaScript: Validate equal lengths before zipping when missing counterparts would be an error.
JavaScript✓ Tested
Pair corresponding array items by position
TypeScript: Validate equal lengths before zipping when missing counterparts would be an error.
TypeScript✓ Tested
Pair corresponding list items
Python: Zip two equally sized sequences into pairs; strict mode rejects mismatched lengths on Python 3.10 or later.
Python✓ Tested
Position an item from the writing direction’s start edge
CSS: Logical insets follow direction, so inline-start is the right side in this RTL container.
CSS✓ Tested
Prepend items while preserving existing array values
Bash Scripts: Construct a new array with the new values before the quoted original expansion.
Bash Scripts✓ Tested
Preserve item state while reordering by key
Preserve item state while reordering by key with a small React component and explicit browser behavior.
React✓ Tested
Prevent an item from shrinking
CSS: Flex-shrink zero preserves a required size even when the container overflows.
CSS✓ Tested
Process items by numeric priority
C#: PriorityQueue removes the item with the smallest priority value first.
C#✓ Tested
Push flex items to opposite ends
CSS: Space-between distributes free main-axis space between items.
CSS✓ Tested