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
PowerShellCollections & objects

Filter items in a pipeline

Keep numbers that meet a condition.

Where-Object✓ Tested
jQueryCollections & styling

Filter parents containing a matching descendant

jQuery: has retains parents with a matching descendant.

jQuery✓ Tested
jQueryCollections & styling

Find an element’s position among siblings

jQuery: index without arguments reports a zero-based sibling position.

jQuery✓ Tested
jQueryCollections & styling

Measure content, padding, and borders separately

jQuery: width, innerWidth, and outerWidth measure different parts of the box.

jQuery✓ Tested
jQueryCollections & styling

Read an element’s document coordinates

jQuery: offset returns coordinates relative to the document.

jQuery✓ Tested
PowerShellCollections & objects

Sort and deduplicate values

Produce an ordered list without duplicates.

Sort-Object✓ Tested
PowerShellCollections & objects

Sum a collection

Calculate a total with Measure-Object.

Measure-Object✓ Tested
jQueryCollections & styling

Transform a collection into a plain array

jQuery: map followed by get returns ordinary JavaScript values.

jQuery✓ Tested
PowerShellHashtables & object records

Add a calculated property during selection

PowerShell: A calculated property can derive a value while retaining selected original properties.

PowerShell✓ Tested
C#Collections & data structures

Add a dictionary entry only if absent

C#: TryAdd reports a duplicate key without replacing its existing value.

C#✓ Tested
CSSVisual treatment & accessibility

Align an image within its content box

CSS: Object-position places the rendered object when fitting leaves spare space or crops an edge.

CSS✓ Tested
HTMLForm behavior

Associate a control outside the form element

HTML: The form attribute links an external named control to the form’s ID.

HTML✓ Tested