Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/denocordts/deps.ts>Collection#sorted

An Object Oriented Discord API wrapper for Deno.
Latest
method Collection.prototype.sorted
import { Collection } from "https://deno.land/x/denocordts@1.2.0/deps.ts";

The sorted method sorts the items of a collection and returns it. The sort is not necessarily stable in Node 10 or older. The default sort order is according to string Unicode code points.

Examples

collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);

Parameters

optional
compareFunction: (
firstValue: V,
secondValue: V,
firstKey: K,
secondKey: K,
) => number
= [UNSUPPORTED]