Results for “Array traversal & selection”
Small, practical examples. Search by task or narrow things down below.
Track a selected record by its identifier
Track a selected record by its identifier with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Transform each item in a collection
Build a result array with a foreach expression.
foreach✓ Tested
Use a fixed-size container with bounds checking
C++: std::array retains its element count and supports checked access through at.
C++✓ Tested
Use named states for a controller
Arduino / C: An enum makes state transitions easier to read than unexplained numbers.
Arduino / C✓ Tested
Find descendants
Select only matching descendants of a jQuery container.
jQuery✓ Tested
Find the nearest matching ancestor
Read a parent row attribute using jQuery closest.
jQuery✓ Tested
Read checked options
Collect checked checkbox values with jQuery map and get.
jQuery✓ Tested
Visit selected elements
Use jQuery each to label every item with its one-based position.
jQuery✓ Tested
Check JSONB containment
Test whether an object contains a key-value pair.
jsonb✓ Tested
Check whether any selected element matches
jQuery: is returns a Boolean without changing the selection.
jQuery✓ Tested
Count matching values
Count even numbers in a fixed C array.
C✓ Tested
Enumerate matching files recursively
C#: Sort relative filenames when reproducible traversal output is required.
C#✓ Tested