Skip to content

isEmpty

Checks whether the string contains no characters by reading length === 0. The check uses the raw string value, so whitespace still counts as content.

Usage

ts
const value = '';
const missingValue = value.isEmpty();

// true

Returns

true when the string length is 0.

Type signature

ts
interface String {
    isEmpty(): boolean;
}

All packages are released under the MIT License.