FIND YOUR NEXT FEW LINES

Results for “Map”

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

76 snippets foundClear filters
TypeScriptObject behavior & collections

Remove a Map entry and detect whether it existed

TypeScript: Map.delete returns true only when an entry was present.

TypeScript✓ Tested
C++Containers & compound values

Remove a map entry and inspect the number removed

C++: erase by key reports whether a unique-key map contained the entry.

C++✓ Tested
GoMaps & sets

Sort map keys for stable output

Sort map keys for stable output using a complete Go program with explicit sample inputs.

Go✓ Tested
RustIterators & transformations

Transform each value with map

Transform each value with map in a complete Rust program using the standard library.

Rust✓ Tested
RustMaps & sets

Update an existing map value

Update an existing map value in a complete Rust program using the standard library.

Rust✓ Tested
C++Containers & compound values

Use a hash map for direct key lookup

C++: unordered_map provides key lookup without promising iteration order.

C++✓ Tested
PythonMappings & sets

Check whether all required keys exist

Python: Compare the required key set with a dictionary key view.

Python✓ Tested
RustMaps & sets

Collect unique sorted values

Collect unique sorted values in a complete Rust program using the standard library.

Rust✓ Tested
PowerShellHashtables & object records

Convert an object’s properties into a hashtable

PowerShell: Enumerate PSObject.Properties when the set of property names is known only at runtime.

PowerShell✓ Tested
PythonMappings & sets

Copy nested mutable data independently

Python: Use deepcopy when changes to nested lists must not affect the original object.

Python✓ Tested
GoMaps & sets

Count repeated words

Count repeated words using a complete Go program with explicit sample inputs.

Go✓ Tested
RustMaps & sets

Count values with the entry API

Count values with the entry API in a complete Rust program using the standard library.

Rust✓ Tested