@tempots/std

compareStrings() function

It compares to string and it returns a negative number if a is inferior to b, zero if they are the same, or otherwise a positive non-sero number.

Signature:

compareStrings: (a: string, b: string) => number

Parameters

Parameter

Type

Description

a

string

The first string to compare.

b

string

The second string to compare.

Returns: number

A negative number if a is less than b, zero if they are equal, or a positive number if a is greater than b.