Results for “id”
Small, practical examples. Search by task or narrow things down below.
Describe an object with an interface
Require named fields on a reusable object shape.
interface✓ Tested
Detect truncated formatted output
Arduino / C: snprintf returns the length it would have written, excluding the null terminator.
Arduino / C✓ Tested
Disable a button
Set the live disabled property with jQuery prop.
jQuery✓ Tested
Disable animations for a reduced-motion mode
jQuery: The global fx.off switch causes effects to finish immediately.
jQuery✓ Tested
Discard an unstaged edit to one tracked file
Git: Restore copies the index version back into the selected working file.
Git✓ Tested
Dismiss a modal with the Escape key
HTML: Native modal dialogs provide keyboard dismissal and return focus to their invoker.
HTML✓ Tested
Dispatch a command through function pointers
Arduino / C: A small function table can map validated command indices to actions.
Arduino / C✓ Tested
Dispatch a one-character serial command
Arduino / C: A switch provides explicit handling for accepted and unknown commands.
Arduino / C✓ Tested
Display an integer as unsigned
Java: Use unsigned conversion methods when interpreting a fixed-width bit pattern.
Java✓ Tested
Distinguish a bare repository from a working checkout
Git: rev-parse reports repository mode without relying on directory naming conventions.
Git✓ Tested
Distinguish an own property from an inherited one
JavaScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
JavaScript✓ Tested
Distinguish an own property from an inherited one
TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
TypeScript✓ Tested