deno.land / std@0.166.0 / collections / _comparators.ts

_comparators.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license./** This module is browser compatible. */
/** Compares its two arguments for ascending order using JavaScript's built in comparison operators. */export function ascend<T>(a: T, b: T) { return a < b ? -1 : a > b ? 1 : 0;}
/** Compares its two arguments for descending order using JavaScript's built in comparison operators. */export function descend<T>(a: T, b: T) { return a < b ? 1 : a > b ? -1 : 0;}
std
Deno standard library
GitHub Repositorydenoland/deno_std
GitHub Stars
2458

Version Info

Tagged at
2 months ago