FIND YOUR NEXT FEW LINES

Results for “collection”

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

146 snippets foundClear filters
JavaScriptObject behavior & collections

Build an object from key-value entries

JavaScript: Object.fromEntries converts an iterable of pairs into ordinary own properties.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Build an object from key-value entries

TypeScript: Object.fromEntries converts an iterable of pairs into ordinary own properties.

TypeScript✓ Tested
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
GoSlices & collections

Copy a slice without sharing storage

Copy a slice without sharing storage using a complete Go program with explicit sample inputs.

Go✓ 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
GoSlices & collections

Deduplicate sorted values

Deduplicate sorted values using a complete Go program with explicit sample inputs.

Go✓ 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

Filter parents containing a matching descendant

jQuery: has retains parents with a matching descendant.

jQuery✓ Tested
GoSlices & collections

Filter values into a new slice

Filter values into a new slice using a complete Go program with explicit sample inputs.

Go✓ Tested