Results for “id”
Small, practical examples. Search by task or narrow things down below.
Clamp a number to inclusive bounds
PowerShell: Math.Clamp chooses the nearest endpoint for an out-of-range value.
PowerShell✓ Tested
Clip content that exceeds a fixed-height box
CSS: Overflow hidden clips the painted content while the full content remains in the DOM.
CSS✓ Tested
Collapse a panel after an animation
jQuery: slideUp hides the panel when the transition completes.
jQuery✓ Tested
Collect selected options from a multi-select
Collect selected options from a multi-select with a small React component and explicit browser behavior.
React✓ Tested
Compare bounded floating-point results with a tolerance
JavaScript: Use an absolute error threshold for values known to be near one.
JavaScript✓ Tested
Compare bounded floating-point results with a tolerance
TypeScript: Use an absolute error threshold for values known to be near one.
TypeScript✓ Tested
Compare Unicode text without case
Python: Casefold handles more Unicode case mappings than lower for caseless comparison.
Python✓ Tested
Control a multiline text field
Control a multiline text field with a small React component and explicit browser behavior.
React✓ Tested
Control a radio-button group
Control a radio-button group with a small React component and explicit browser behavior.
React✓ Tested
Convert ASCII text to lowercase safely
C++: Cast each byte to unsigned char before using the cctype function.
C++✓ Tested
Convert between integer bases
JavaScript: Supply a radix when parsing a nondecimal integer string.
JavaScript✓ Tested
Convert between integer bases
TypeScript: Supply a radix when parsing a nondecimal integer string.
TypeScript✓ Tested