FIND YOUR NEXT FEW LINES

Results for “IS NULL”

Small, practical examples. Search by task or narrow things down below.

1898 snippets foundClear filters
GitRemotes & additional checkouts

Distinguish a bare repository from a working checkout

Git: rev-parse reports repository mode without relying on directory naming conventions.

Git✓ Tested
PowerShellFile operations & integrity

Distinguish a file from a directory

PowerShell: Test-Path can constrain the kind of item that is accepted.

PowerShell✓ Tested
Bash ScriptsDiagnostics & defensive scripting

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
JavaScriptObject behavior & collections

Distinguish an own property from an inherited one

JavaScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Distinguish an own property from an inherited one

TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.

TypeScript✓ Tested
jQueryForm serialization & state

Distinguish current state from initial markup

jQuery: prop reads the live checked state; attr reads the original checked attribute.

jQuery✓ Tested
GoTesting & reusable helpers

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
GoMaps & sets

Distinguish missing keys from zero values

Distinguish missing keys from zero values using a complete Go program with explicit sample inputs.

Go✓ Tested
GitGetting Started

Distinguish staged changes from working edits

Git: Distinguish staged changes from working edits inside the disposable repository created by the input setup.

Git✓ Tested
Bash ScriptsParameter expansion

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
RustStrings & Unicode

Distinguish UTF-8 bytes from characters

Distinguish UTF-8 bytes from characters in a complete Rust program using the standard library.

Rust✓ Tested
JavaPrecise numeric calculations

Divide decimal values with controlled precision

Java: Choose both scale and rounding for a quotient that does not terminate in base ten.

Java✓ Tested