Results for “Array traversal & selection”
Small, practical examples. Search by task or narrow things down below.
Select an immediate parent
jQuery: parent moves exactly one level up the DOM.
jQuery✓ Tested
Select direct children without deeper descendants
jQuery: children limits matching to one level.
jQuery✓ Tested
Select siblings up to a boundary
jQuery: nextUntil excludes the boundary element itself.
jQuery✓ Tested
Select siblings while excluding the current element
jQuery: siblings selects other children of the same parent.
jQuery✓ Tested
Select the immediately following sibling
jQuery: next does not search beyond the next sibling.
jQuery✓ Tested
Select the immediately preceding sibling
jQuery: prev moves backward by one sibling.
jQuery✓ Tested
Filter a selection
Reduce a jQuery selection to elements with a matching class.
jQuery✓ Tested
Add a calculated property during selection
PowerShell: A calculated property can derive a value while retaining selected original properties.
PowerShell✓ Tested
Allocate a zeroed array
Check calloc, use the allocation, and release it in C.
C✓ Tested
Allocate and free a typed array
C: Use sizeof on the pointed-to type and check allocation success before writing.
C✓ Tested
Append an item to a small array
PowerShell: The plus-equals operator builds a new array; use a generic list for repeated large additions.
PowerShell✓ Tested
Append several items to an array
Bash Scripts: Array-plus-equals adds elements without losing spaces inside a quoted item.
Bash Scripts✓ Tested