Skip to content

sort

sort() sorts an array of wrapped primitives (String, Number, Date, Time) in "ASC" or "DSC". Supports the curried version to integrate easily in a pipeline.

Interactive example

Syntax

Classic signature

typescript
function sort(
	input: readonly (String | Number | Date | Time | string | number | TheDate | TheTime)[], 
	type: SortType
): any[]

Curried signature

typescript
function sort(
	type: SortType
): (
	input: readonly (String | Number | Date | Time | string | number | TheDate | TheTime)[]
) => any[]

Parameters

  • input : array of primitives (wrapped or raw).
  • type : "ASC" or "DSC".

Return value

A new sorted array, whose elements are wrapped.

Released under the MIT license.