FIND YOUR NEXT FEW LINES

Results for “Object behavior & collections”

Small, practical examples. Search by task or narrow things down below.

631 snippets foundClear filters
C++Collections

Sort and deduplicate values

Sort a C++ vector and erase adjacent duplicates.

C++✓ Tested
PythonCollections

Sort dictionaries by a value

Sort a list of dictionaries by a numeric field, leaving the original list unchanged.

sort✓ Tested
C#Collections

Sort values with LINQ

Create an ascending sequence from C# integer values.

C#✓ Tested
HTMLTables & list numbering

Span a group header across several rows

HTML: Rowspan can label a group of related rows without repeating the label.

HTML✓ Tested
HTMLTables & list numbering

Span one header across several columns

HTML: Colspan lets a heading cover a defined number of columns in the table grid.

HTML✓ Tested
HTMLNative disclosure & dialogs

Start a disclosure open while keeping it collapsible

HTML: The open attribute sets the initial details state without JavaScript.

HTML✓ Tested
jQueryDeferred work & queues

Start a named queue explicitly

jQuery: Named queues wait until dequeue starts them.

jQuery✓ Tested
jQueryEvent control

Stop a child event from reaching its parent

jQuery: stopPropagation leaves other handlers on the same element intact.

jQuery✓ Tested
AngularEvents & DOM interaction

Stop a nested click from reaching its parent

Stop a nested click from reaching its parent with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactAccessibility & events

Stop an event from reaching a parent handler

Stop an event from reaching a parent handler with a small React component and explicit browser behavior.

React✓ Tested
jQueryAnimation completion

Stop current animation and discard later work

jQuery: stop with clearQueue and jumpToEnd finishes the current animation and removes pending ones.

jQuery✓ Tested
ReactRefs & DOM interaction

Store and cancel a timer handle

Store and cancel a timer handle with a small React component and explicit browser behavior.

React✓ Tested