Results for “target”
Small, practical examples. Search by task or narrow things down below.
Pair corresponding array items by position
TypeScript: Validate equal lengths before zipping when missing counterparts would be an error.
TypeScript✓ Tested
Percent-encode one URL component
TypeScript: encodeURIComponent escapes a parameter value rather than a complete URL.
TypeScript✓ Tested
Play a fixed digital output pattern
Arduino / C: A pattern table separates the output sequence from its timing.
Arduino / C✓ Tested
Preserve a fractional result
Arduino / C: Preserve a fractional result on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Prevent output chatter with separate thresholds
Arduino / C: Use different on and off thresholds to retain state between them.
Arduino / C✓ Tested
Prevent runtime changes to top-level properties
TypeScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.
TypeScript✓ Tested
Print a fixed text buffer
Arduino / C: Print a fixed text buffer on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Print a floating-point value with fixed precision
Choose the number of decimal places in serial output.
float✓ Tested
Print a label beside a number
Arduino / C: Combine Serial.print and Serial.println to put text and a value on one line.
Arduino / C✓ Tested
Print a message to the Serial Monitor
Send a line once when the sketch starts.
Serial✓ Tested
Print a number with two decimal places
TypeScript: Format a small decimal value consistently for display.
TypeScript✓ Tested
Print a single character
Arduino / C: Print a single character on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested