FIND YOUR NEXT FEW LINES

Results for “Collections & data structures”

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

694 snippets foundClear filters
HTMLMetadata & document links

Declare an indexing preference for a draft page

HTML: A robots meta element can request noindex while allowing link following.

HTML✓ Tested
RustParsing & byte data

Decode bytes as validated UTF-8

Decode bytes as validated UTF-8 in a complete Rust program using the standard library.

Rust✓ Tested
GoSlices & collections

Deduplicate sorted values

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

Go✓ Tested
RustFunctions & data types

Define behavior with a trait

Define behavior with a trait in a complete Rust program using the standard library.

Rust✓ Tested
JavaFile operations & binary data

Delete a known temporary file if present

Java: deleteIfExists returns whether a file was removed and still reports other I/O errors.

Java✓ Tested
RustFunctions & data types

Derive comparison and debugging behavior

Derive comparison and debugging behavior in a complete Rust program using the standard library.

Rust✓ 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
RustParsing & byte data

Encode an integer as big-endian bytes

Encode an integer as big-endian bytes in a complete Rust program using the standard library.

Rust✓ Tested
jQueryCollections & styling

Exclude elements from a collection

jQuery: not removes matching elements from the current selection.

jQuery✓ Tested
AngularLifecycle & observable data

Filter observable emissions

Filter observable emissions with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
jQueryCollections & styling

Filter parents containing a matching descendant

jQuery: has retains parents with a matching descendant.

jQuery✓ Tested