Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp core library.version.compare

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-core-library > Version > compare

Version.compare() method

Compares two Version objects to determine which version is newer.

Signature:

static compare(v1: Version, v2: Version): number;

Parameters

Parameter Type Description
v1 Version The first version class for comparison
v2 Version The second version class for comparison

Returns:

number

-1 if the first input is less than the second input; 0 if the first input is equal to the second input; 1 if the first input is greater than the second input.

Clone this wiki locally