Results for “items”
Small, practical examples. Search by task or narrow things down below.
Remove collection items that satisfy a condition
Java: Use removeIf on a mutable collection to avoid changing it manually inside a for-each loop.
Java✓ Tested
Remove matching items from a mutable list
C#: List.RemoveAll returns how many items it removed.
C#✓ Tested
Separate a first item from the remaining items
JavaScript: Array destructuring and a rest element produce named pieces of a sequence.
JavaScript✓ Tested
Separate a first item from the remaining items
TypeScript: Array destructuring and a rest element produce named pieces of a sequence.
TypeScript✓ Tested
Space items with gap
Use CSS gap instead of margins between flex children.
CSS✓ Tested
Stack flex items vertically
CSS: Flex-direction column makes the main axis vertical.
CSS✓ Tested
Style the first and last list items
Style the first and last list items with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Wrap a row of items
Allow CSS flex items to wrap when a row runs out of space.
CSS✓ Tested
Center a small item in a grid cell
CSS: Place-items sets both block-axis and inline-axis item alignment.
CSS✓ Tested
Visit every item in a collection
Python: Print each element in the collection’s original order.
Python✓ Tested
Visit every item in a collection
C#: Print each element in the collection’s original order.
C#✓ Tested
Visit every item in a collection
Java: Print each element in the collection’s original order.
Java✓ Tested