@@ -1238,6 +1238,9 @@ interface Array<T> {
1238
1238
* @param compareFn Function used to determine the order of the elements. It is expected to return
1239
1239
* a negative value if first argument is less than second argument, zero if they're equal and a positive
1240
1240
* 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
+ * ```
1241
1244
*/
1242
1245
sort ( compareFn ?: ( a : T , b : T ) => number ) : this;
1243
1246
/**
@@ -1881,6 +1884,9 @@ interface Int8Array {
1881
1884
* @param compareFn Function used to determine the order of the elements. It is expected to return
1882
1885
* a negative value if first argument is less than second argument, zero if they're equal and a positive
1883
1886
* 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
+ * ```
1884
1890
*/
1885
1891
sort ( compareFn ?: ( a : number , b : number ) => number ) : this;
1886
1892
@@ -2157,6 +2163,9 @@ interface Uint8Array {
2157
2163
* @param compareFn Function used to determine the order of the elements. It is expected to return
2158
2164
* a negative value if first argument is less than second argument, zero if they're equal and a positive
2159
2165
* 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
+ * ```
2160
2169
*/
2161
2170
sort ( compareFn ?: ( a : number , b : number ) => number ) : this;
2162
2171
@@ -2433,6 +2442,9 @@ interface Uint8ClampedArray {
2433
2442
* @param compareFn Function used to determine the order of the elements. It is expected to return
2434
2443
* a negative value if first argument is less than second argument, zero if they're equal and a positive
2435
2444
* 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
+ * ```
2436
2448
*/
2437
2449
sort ( compareFn ?: ( a : number , b : number ) => number ) : this;
2438
2450
@@ -2707,6 +2719,9 @@ interface Int16Array {
2707
2719
* @param compareFn Function used to determine the order of the elements. It is expected to return
2708
2720
* a negative value if first argument is less than second argument, zero if they're equal and a positive
2709
2721
* 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
+ * ```
2710
2725
*/
2711
2726
sort ( compareFn ?: ( a : number , b : number ) => number ) : this;
2712
2727
@@ -2984,6 +2999,9 @@ interface Uint16Array {
2984
2999
* @param compareFn Function used to determine the order of the elements. It is expected to return
2985
3000
* a negative value if first argument is less than second argument, zero if they're equal and a positive
2986
3001
* 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
+ * ```
2987
3005
*/
2988
3006
sort ( compareFn ?: ( a : number , b : number ) => number ) : this;
2989
3007
@@ -3260,6 +3278,9 @@ interface Int32Array {
3260
3278
* @param compareFn Function used to determine the order of the elements. It is expected to return
3261
3279
* a negative value if first argument is less than second argument, zero if they're equal and a positive
3262
3280
* 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
+ * ```
3263
3284
*/
3264
3285
sort ( compareFn ?: ( a : number , b : number ) => number ) : this;
3265
3286
@@ -3535,6 +3556,9 @@ interface Uint32Array {
3535
3556
* @param compareFn Function used to determine the order of the elements. It is expected to return
3536
3557
* a negative value if first argument is less than second argument, zero if they're equal and a positive
3537
3558
* 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
+ * ```
3538
3562
*/
3539
3563
sort ( compareFn ?: ( a : number , b : number ) => number ) : this;
3540
3564
@@ -3811,6 +3835,9 @@ interface Float32Array {
3811
3835
* @param compareFn Function used to determine the order of the elements. It is expected to return
3812
3836
* a negative value if first argument is less than second argument, zero if they're equal and a positive
3813
3837
* 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
+ * ```
3814
3841
*/
3815
3842
sort ( compareFn ?: ( a : number , b : number ) => number ) : this;
3816
3843
@@ -4088,6 +4115,9 @@ interface Float64Array {
4088
4115
* @param compareFn Function used to determine the order of the elements. It is expected to return
4089
4116
* a negative value if first argument is less than second argument, zero if they're equal and a positive
4090
4117
* 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
+ * ```
4091
4121
*/
4092
4122
sort ( compareFn ?: ( a : number , b : number ) => number ) : this;
4093
4123
0 commit comments