Results for “save file”
Small, practical examples. Search by task or narrow things down below.
Display code as text
Escape angle brackets in preformatted HTML code samples.
HTML✓ Tested
Display reserved characters as text
HTML: Learn how to display reserved characters as text in a complete browser example.
HTML✓ 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 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 staged changes from working edits
Git: Distinguish staged changes from working edits inside the disposable repository created by the input setup.
Git✓ Tested
Distinguish unset variables from empty strings
Bash Scripts: Omitting the colon tests only whether a variable is unset; including it also treats an empty value as missing.
Bash Scripts✓ Tested
Divide decimal values with controlled precision
Java: Choose both scale and rounding for a quotient that does not terminate in base ten.
Java✓ Tested
Divide grid space in a chosen proportion
CSS: Fraction units divide the remaining track space proportionally.
CSS✓ Tested
Divide negative integers with floor rounding
Java: floorDiv and floorMod provide consistent floor-based quotient and remainder.
Java✓ Tested