Skip to content

equals

Compares the string with another string using strict equality. The comparison is case-sensitive and does not trim whitespace.

Usage

ts
const isSameRole = 'admin'.equals('admin');

// true

Parameters

NameTypeDescription
valuestringString to compare against.

Returns

true when both strings are equal.

Type signature

ts
interface String {
    equals(value: string): boolean;
}

All packages are released under the MIT License.