Skip to content

Commit 63d940d

Browse files
authored
Added example of sortFn
1 parent 2c8df45 commit 63d940d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/lib/es5.d.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,9 @@ interface Array<T> {
12381238
* @param compareFn Function used to determine the order of the elements. It is expected to return
12391239
* a negative value if first argument is less than second argument, zero if they're equal and a positive
12401240
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
1241+
* ```ts
1242+
* [11,2,22,1].sort((a, b) => a - b)
1243+
* ```
12411244
*/
12421245
sort(compareFn?: (a: T, b: T) => number): this;
12431246
/**
@@ -1881,6 +1884,9 @@ interface Int8Array {
18811884
* @param compareFn Function used to determine the order of the elements. It is expected to return
18821885
* a negative value if first argument is less than second argument, zero if they're equal and a positive
18831886
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
1887+
* ```ts
1888+
* [11,2,22,1].sort((a, b) => a - b)
1889+
* ```
18841890
*/
18851891
sort(compareFn?: (a: number, b: number) => number): this;
18861892

@@ -2157,6 +2163,9 @@ interface Uint8Array {
21572163
* @param compareFn Function used to determine the order of the elements. It is expected to return
21582164
* a negative value if first argument is less than second argument, zero if they're equal and a positive
21592165
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
2166+
* ```ts
2167+
* [11,2,22,1].sort((a, b) => a - b)
2168+
* ```
21602169
*/
21612170
sort(compareFn?: (a: number, b: number) => number): this;
21622171

@@ -2433,6 +2442,9 @@ interface Uint8ClampedArray {
24332442
* @param compareFn Function used to determine the order of the elements. It is expected to return
24342443
* a negative value if first argument is less than second argument, zero if they're equal and a positive
24352444
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
2445+
* ```ts
2446+
* [11,2,22,1].sort((a, b) => a - b)
2447+
* ```
24362448
*/
24372449
sort(compareFn?: (a: number, b: number) => number): this;
24382450

@@ -2707,6 +2719,9 @@ interface Int16Array {
27072719
* @param compareFn Function used to determine the order of the elements. It is expected to return
27082720
* a negative value if first argument is less than second argument, zero if they're equal and a positive
27092721
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
2722+
* ```ts
2723+
* [11,2,22,1].sort((a, b) => a - b)
2724+
* ```
27102725
*/
27112726
sort(compareFn?: (a: number, b: number) => number): this;
27122727

@@ -2984,6 +2999,9 @@ interface Uint16Array {
29842999
* @param compareFn Function used to determine the order of the elements. It is expected to return
29853000
* a negative value if first argument is less than second argument, zero if they're equal and a positive
29863001
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
3002+
* ```ts
3003+
* [11,2,22,1].sort((a, b) => a - b)
3004+
* ```
29873005
*/
29883006
sort(compareFn?: (a: number, b: number) => number): this;
29893007

@@ -3260,6 +3278,9 @@ interface Int32Array {
32603278
* @param compareFn Function used to determine the order of the elements. It is expected to return
32613279
* a negative value if first argument is less than second argument, zero if they're equal and a positive
32623280
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
3281+
* ```ts
3282+
* [11,2,22,1].sort((a, b) => a - b)
3283+
* ```
32633284
*/
32643285
sort(compareFn?: (a: number, b: number) => number): this;
32653286

@@ -3535,6 +3556,9 @@ interface Uint32Array {
35353556
* @param compareFn Function used to determine the order of the elements. It is expected to return
35363557
* a negative value if first argument is less than second argument, zero if they're equal and a positive
35373558
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
3559+
* ```ts
3560+
* [11,2,22,1].sort((a, b) => a - b)
3561+
* ```
35383562
*/
35393563
sort(compareFn?: (a: number, b: number) => number): this;
35403564

@@ -3811,6 +3835,9 @@ interface Float32Array {
38113835
* @param compareFn Function used to determine the order of the elements. It is expected to return
38123836
* a negative value if first argument is less than second argument, zero if they're equal and a positive
38133837
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
3838+
* ```ts
3839+
* [11,2,22,1].sort((a, b) => a - b)
3840+
* ```
38143841
*/
38153842
sort(compareFn?: (a: number, b: number) => number): this;
38163843

@@ -4088,6 +4115,9 @@ interface Float64Array {
40884115
* @param compareFn Function used to determine the order of the elements. It is expected to return
40894116
* a negative value if first argument is less than second argument, zero if they're equal and a positive
40904117
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
4118+
* ```ts
4119+
* [11,2,22,1].sort((a, b) => a - b)
4120+
* ```
40914121
*/
40924122
sort(compareFn?: (a: number, b: number) => number): this;
40934123

0 commit comments

Comments
 (0)