FIND YOUR NEXT FEW LINES

Results for “Slices & collections”

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

98 snippets foundClear filters
jQueryCollections & styling

Check whether any selected element matches

jQuery: is returns a Boolean without changing the selection.

jQuery✓ Tested
jQueryCollections & styling

Combine two selections

jQuery: add returns a combined collection in document order.

jQuery✓ Tested
JavaScriptObject behavior & collections

Copy nested structured data independently

JavaScript: structuredClone creates an independent copy of supported structured values.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Copy nested structured data independently

TypeScript: structuredClone creates an independent copy of supported structured values.

TypeScript✓ Tested
JavaScriptObject behavior & collections

Distinguish an own property from an inherited one

JavaScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Distinguish an own property from an inherited one

TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.

TypeScript✓ Tested
jQueryCollections & styling

Exclude elements from a collection

jQuery: not removes matching elements from the current selection.

jQuery✓ 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
JavaScriptObject behavior & collections

Find members absent from another set

JavaScript: Negate a membership test to calculate the set difference.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Find members absent from another set

TypeScript: Negate a membership test to calculate the set difference.

TypeScript✓ Tested
JavaScriptObject behavior & collections

Find shared members of two sets

JavaScript: Filter one set through the other set’s membership test.

JavaScript✓ Tested