Results for “Slices & collections”
Small, practical examples. Search by task or narrow things down below.
Process a slice in bounded chunks
Process a slice in bounded chunks in a complete Rust program using the standard library.
Rust✓ Tested
Process items by numeric priority
C#: PriorityQueue removes the item with the smallest priority value first.
C#✓ Tested
Read an element’s document coordinates
jQuery: offset returns coordinates relative to the document.
jQuery✓ Tested
Read an object’s own enumerable values
JavaScript: Object.values provides values without their corresponding keys.
JavaScript✓ Tested
Read an object’s own enumerable values
TypeScript: Object.values provides values without their corresponding keys.
TypeScript✓ Tested
Remove a Map entry and detect whether it existed
JavaScript: Map.delete returns true only when an entry was present.
JavaScript✓ Tested
Remove a Map entry and detect whether it existed
TypeScript: Map.delete returns true only when an entry was present.
TypeScript✓ Tested
Remove and collect a vector range
Remove and collect a vector range in a complete Rust program using the standard library.
Rust✓ Tested
Remove matching items from a mutable list
C#: List.RemoveAll returns how many items it removed.
C#✓ Tested
Search a sorted array efficiently
C#: Array.BinarySearch requires an array sorted with the same comparison rules.
C#✓ Tested
Search a sorted slice
Search a sorted slice in a complete Rust program using the standard library.
Rust✓ Tested
Set several inline styles together
jQuery: Pass a property-value object to css.
jQuery✓ Tested