Results for “Collections & data structures”
Small, practical examples. Search by task or narrow things down below.
Declare an indexing preference for a draft page
HTML: A robots meta element can request noindex while allowing link following.
HTML✓ Tested
Decode bytes as validated UTF-8
Decode bytes as validated UTF-8 in a complete Rust program using the standard library.
Rust✓ Tested
Deduplicate sorted values
Deduplicate sorted values using a complete Go program with explicit sample inputs.
Go✓ Tested
Define behavior with a trait
Define behavior with a trait in a complete Rust program using the standard library.
Rust✓ Tested
Delete a known temporary file if present
Java: deleteIfExists returns whether a file was removed and still reports other I/O errors.
Java✓ Tested
Derive comparison and debugging behavior
Derive comparison and debugging behavior in a complete Rust program using the standard library.
Rust✓ Tested
Distinguish an own property from an inherited one
JavaScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
JavaScript✓ Tested
Distinguish an own property from an inherited one
TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
TypeScript✓ Tested
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
Exclude elements from a collection
jQuery: not removes matching elements from the current selection.
jQuery✓ Tested
Filter observable emissions
Filter observable emissions with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Filter parents containing a matching descendant
jQuery: has retains parents with a matching descendant.
jQuery✓ Tested