Results for “key”
Small, practical examples. Search by task or narrow things down below.
Build an object from key-value entries
JavaScript: Object.fromEntries converts an iterable of pairs into ordinary own properties.
JavaScript✓ Tested
Build an object from key-value entries
TypeScript: Object.fromEntries converts an iterable of pairs into ordinary own properties.
TypeScript✓ Tested
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
Check whether all required keys exist
Python: Compare the required key set with a dictionary key view.
Python✓ Tested
Dismiss a modal with the Escape key
HTML: Native modal dialogs provide keyboard dismissal and return focus to their invoker.
HTML✓ Tested
Distinguish missing keys from zero values
Distinguish missing keys from zero values using a complete Go program with explicit sample inputs.
Go✓ Tested
Enable and use foreign keys
Turn on relationship enforcement for the connection.
foreign keys✓ Tested
Handle an Escape key press
Handle an Escape key press with a small React component and explicit browser behavior.
React✓ Tested
Handle the Enter key specifically
Handle the Enter key specifically with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Highlight a group containing keyboard focus
CSS: Focus-within matches a parent when any descendant has focus.
CSS✓ Tested
Index records by a unique key
Java: Use toMap with an explicit merge rule so duplicate keys have defined behavior.
Java✓ Tested
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