Results for “on”
Small, practical examples. Search by task or narrow things down below.
Display reserved characters as text
HTML: Learn how to display reserved characters as text in a complete browser example.
HTML✓ Tested
Display the result of an asynchronous action
Display the result of an asynchronous action with a small React component and explicit browser behavior.
React✓ Tested
Display untrusted-looking text without HTML execution
Display untrusted-looking text without HTML execution with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Distinguish a bare repository from a working checkout
Git: rev-parse reports repository mode without relying on directory naming conventions.
Git✓ Tested
Distinguish a file from a directory
PowerShell: Test-Path can constrain the kind of item that is accepted.
PowerShell✓ 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 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
Distinguish current state from initial markup
jQuery: prop reads the live checked state; attr reads the original checked attribute.
jQuery✓ 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
Distinguish missing keys from zero values
Distinguish missing keys from zero values using a complete Go program with explicit sample inputs.
Go✓ Tested
Distinguish row count from non-null value count
SQL: COUNT(*) includes every row while COUNT(column) skips NULL values.
SQL✓ Tested