FIND YOUR NEXT FEW LINES

Results for “Slices & collections”

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

98 snippets foundClear filters
TypeScriptObject behavior & collections

Find shared members of two sets

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

TypeScript✓ Tested
C#Collections & data structures

Find values missing from another collection

C#: Except removes duplicates as it calculates the set difference.

C#✓ Tested
JavaScriptObject behavior & collections

Group records into map entries

JavaScript: Initialize an array for a missing Map key before appending its values.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Group records into map entries

TypeScript: Initialize an array for a missing Map key before appending its values.

TypeScript✓ Tested
RustVectors & slices

Inspect overlapping windows

Inspect overlapping windows in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Keep only values satisfying a condition

Keep only values satisfying a condition in a complete Rust program using the standard library.

Rust✓ Tested
JavaScriptObject behavior & collections

List an object’s own enumerable keys

JavaScript: Object.keys omits inherited and non-enumerable properties.

JavaScript✓ Tested
TypeScriptObject behavior & collections

List an object’s own enumerable keys

TypeScript: Object.keys omits inherited and non-enumerable properties.

TypeScript✓ Tested
jQueryCollections & styling

Measure content, padding, and borders separately

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

jQuery✓ Tested
JavaScriptObject behavior & collections

Prevent runtime changes to top-level properties

JavaScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Prevent runtime changes to top-level properties

TypeScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.

TypeScript✓ Tested
C#Collections & data structures

Process a FIFO queue

C#: Queue removes elements in the order they were enqueued.

C#✓ Tested