mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Added example of sortFn
This commit is contained in:
parent
2c8df45aa9
commit
63d940da53
30
src/lib/es5.d.ts
vendored
30
src/lib/es5.d.ts
vendored
@ -1238,6 +1238,9 @@ interface Array<T> {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: T, b: T) => number): this;
|
||||
/**
|
||||
@ -1881,6 +1884,9 @@ interface Int8Array {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: number, b: number) => number): this;
|
||||
|
||||
@ -2157,6 +2163,9 @@ interface Uint8Array {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: number, b: number) => number): this;
|
||||
|
||||
@ -2433,6 +2442,9 @@ interface Uint8ClampedArray {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: number, b: number) => number): this;
|
||||
|
||||
@ -2707,6 +2719,9 @@ interface Int16Array {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: number, b: number) => number): this;
|
||||
|
||||
@ -2984,6 +2999,9 @@ interface Uint16Array {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: number, b: number) => number): this;
|
||||
|
||||
@ -3260,6 +3278,9 @@ interface Int32Array {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: number, b: number) => number): this;
|
||||
|
||||
@ -3535,6 +3556,9 @@ interface Uint32Array {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: number, b: number) => number): this;
|
||||
|
||||
@ -3811,6 +3835,9 @@ interface Float32Array {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: number, b: number) => number): this;
|
||||
|
||||
@ -4088,6 +4115,9 @@ interface Float64Array {
|
||||
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
||||
* a negative value if first argument is less than second argument, zero if they're equal and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
|
||||
* ```ts
|
||||
* [11,2,22,1].sort((a, b) => a - b)
|
||||
* ```
|
||||
*/
|
||||
sort(compareFn?: (a: number, b: number) => number): this;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user