Results for “input”
Small, practical examples. Search by task or narrow things down below.
Detect NaN without converting the input
TypeScript: Number.isNaN tests the special numeric value instead of applying string-to-number conversion.
TypeScript✓ Tested
Distinguish an empty input line from end of input
Bash Scripts: A successful read can return an empty value; its status indicates whether a line was read.
Bash Scripts✓ Tested
Distinguish end-of-input from other errors
Distinguish end-of-input from other errors using a complete Go program with explicit sample inputs.
Go✓ Tested
Exercise a function with a table of inputs
Exercise a function with a table of inputs in a complete Rust program using the standard library.
Rust✓ Tested
Expose an input with a public alias
Expose an input with a public alias with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Focus an input through a ref
Focus an input through a ref with a small React component and explicit browser behavior.
React✓ Tested
Focus an input through its template reference
Focus an input through its template reference with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Forward input props to a reusable field
Forward input props to a reusable field with a small React component and explicit browser behavior.
React✓ Tested
Handle incomplete serial input
Arduino / C: The returned byte count distinguishes a complete payload from a timed-out partial one.
Arduino / C✓ Tested
Handle malformed JSON input
Python: Catch JSONDecodeError without hiding unrelated programming errors.
Python✓ Tested
Keep numeric input text until conversion
Keep numeric input text until conversion with a small React component and explicit browser behavior.
React✓ Tested
Limit a numeric input to an inclusive range
HTML: Number inputs expose range validation separately from the entered text.
HTML✓ Tested