FIND YOUR NEXT FEW LINES

Results for “key”

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

160 snippets foundClear filters
JavaScriptObject behavior & collections

Build an object from key-value entries

JavaScript: Object.fromEntries converts an iterable of pairs into ordinary own properties.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Build an object from key-value entries

TypeScript: Object.fromEntries converts an iterable of pairs into ordinary own properties.

TypeScript✓ Tested
PowerShellHashtables & object records

Check for a hashtable key before reading it

PowerShell: ContainsKey distinguishes a missing key from a key whose value happens to be null.

PowerShell✓ Tested
PythonMappings & sets

Check whether all required keys exist

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

Python✓ Tested
HTMLNative disclosure & dialogs

Dismiss a modal with the Escape key

HTML: Native modal dialogs provide keyboard dismissal and return focus to their invoker.

HTML✓ Tested
GoMaps & sets

Distinguish missing keys from zero values

Distinguish missing keys from zero values using a complete Go program with explicit sample inputs.

Go✓ Tested
SQLiteTables & writes

Enable and use foreign keys

Turn on relationship enforcement for the connection.

foreign keys✓ Tested
ReactAccessibility & events

Handle an Escape key press

Handle an Escape key press with a small React component and explicit browser behavior.

React✓ Tested
AngularEvents & DOM interaction

Handle the Enter key specifically

Handle the Enter key specifically with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
CSSInteraction selectors

Highlight a group containing keyboard focus

CSS: Focus-within matches a parent when any descendant has focus.

CSS✓ Tested
JavaStream transformations

Index records by a unique key

Java: Use toMap with an explicit merge rule so duplicate keys have defined behavior.

Java✓ Tested
C++Containers & compound values

Insert a map value only when a key is absent

C++: try_emplace preserves the old value when insertion does not take place.

C++✓ Tested