You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib/es5.d.ts
+29-17
Original file line number
Diff line number
Diff line change
@@ -1199,7 +1199,7 @@ interface ConcatArray<T> {
1199
1199
1200
1200
interfaceArray<T>{
1201
1201
/**
1202
-
* Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
1202
+
* Gets or sets the length of the array. This is a number one higher than the highest index in the array.
1203
1203
*/
1204
1204
length: number;
1205
1205
/**
@@ -1212,44 +1212,54 @@ interface Array<T> {
1212
1212
toLocaleString(): string;
1213
1213
/**
1214
1214
* Removes the last element from an array and returns it.
1215
+
* If the array is empty, undefined is returned and the array is not modified.
1215
1216
*/
1216
1217
pop(): T|undefined;
1217
1218
/**
1218
-
* Appends new elements to an array, and returns the new length of the array.
1219
-
* @param items New elements of the Array.
1219
+
* Appends new elements to the end of an array, and returns the new length of the array.
1220
+
* @param items New elements to add to the array.
1220
1221
*/
1221
1222
push(...items: T[]): number;
1222
1223
/**
1223
1224
* Combines two or more arrays.
1224
-
* @param items Additional items to add to the end of array1.
1225
+
* This method returns a new array without modifying any existing arrays.
1226
+
* @param items Additional arrays and/or items to add to the end of the array.
1225
1227
*/
1226
1228
concat(...items: ConcatArray<T>[]): T[];
1227
1229
/**
1228
1230
* Combines two or more arrays.
1229
-
* @param items Additional items to add to the end of array1.
1231
+
* This method returns a new array without modifying any existing arrays.
1232
+
* @param items Additional arrays and/or items to add to the end of the array.
1230
1233
*/
1231
1234
concat(...items: (T|ConcatArray<T>)[]): T[];
1232
1235
/**
1233
-
* Adds all the elements of an array separated by the specified separator string.
1234
-
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
1236
+
* Adds all the elements of an array into a string, separated by the specified separator string.
1237
+
* @param separator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.
1235
1238
*/
1236
1239
join(separator?: string): string;
1237
1240
/**
1238
-
* Reverses the elements in an Array.
1241
+
* Reverses the elements in an array in place.
1242
+
* This method mutates the array and returns a reference to the same array.
1239
1243
*/
1240
1244
reverse(): T[];
1241
1245
/**
1242
1246
* Removes the first element from an array and returns it.
1247
+
* If the array is empty, undefined is returned and the array is not modified.
1243
1248
*/
1244
1249
shift(): T|undefined;
1245
1250
/**
1246
-
* Returns a section of an array.
1247
-
* @param start The beginning of the specified portion of the array.
1248
-
* @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
1251
+
* Returns a copy of a section of an array.
1252
+
* For both start and end, a negative index can be used to indicate an offset from the end of the array.
1253
+
* For example, -2 refers to the second to last element of the array.
1254
+
* @param start The beginning index of the specified portion of the array.
1255
+
* If start is undefined, then the slice begins at index 0.
1256
+
* @param end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'.
1257
+
* If end is undefined, then the slice extends to the end of the array.
1249
1258
*/
1250
1259
slice(start?: number,end?: number): T[];
1251
1260
/**
1252
-
* Sorts an array.
1261
+
* Sorts an array in place.
1262
+
* This method mutates the array and returns a reference to the same array.
1253
1263
* @param compareFn Function used to determine the order of the elements. It is expected to return
1254
1264
* a negative value if first argument is less than second argument, zero if they're equal and a positive
1255
1265
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
@@ -1262,30 +1272,32 @@ interface Array<T> {
1262
1272
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
1263
1273
* @param start The zero-based location in the array from which to start removing elements.
1264
1274
* @param deleteCount The number of elements to remove.
1275
+
* @returns An array containing the elements that were deleted.
1265
1276
*/
1266
1277
splice(start: number,deleteCount?: number): T[];
1267
1278
/**
1268
1279
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
1269
1280
* @param start The zero-based location in the array from which to start removing elements.
1270
1281
* @param deleteCount The number of elements to remove.
1271
1282
* @param items Elements to insert into the array in place of the deleted elements.
1283
+
* @returns An array containing the elements that were deleted.
Copy file name to clipboardExpand all lines: tests/baselines/reference/promisePermutations3.errors.txt
+2-2
Original file line number
Diff line number
Diff line change
@@ -398,7 +398,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
398
398
!!! error TS2769: The last overload gave the following error.
399
399
!!! error TS2769: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
400
400
!!! error TS2769: Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
401
-
!!! related TS2728 /.ts/lib.es5.d.ts:1448:5: 'catch' is declared here.
401
+
!!! related TS2728 /.ts/lib.es5.d.ts:1460:5: 'catch' is declared here.
402
402
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
403
403
var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok
404
404
@@ -445,5 +445,5 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
445
445
~~~~~~~~~~~~~~~
446
446
!!! error TS2345: Argument of type '{ <T>(x: T): IPromise<T>; <T>(x: T, y: T): Promise<T>; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<unknown>'.
447
447
!!! error TS2345: Property 'catch' is missing in type 'IPromise<any>' but required in type 'Promise<unknown>'.
448
-
!!! related TS2728 /.ts/lib.es5.d.ts:1448:5: 'catch' is declared here.
448
+
!!! related TS2728 /.ts/lib.es5.d.ts:1460:5: 'catch' is declared here.
449
449
var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok
Copy file name to clipboardExpand all lines: tests/cases/fourslash/commentsUnion.ts
+1-1
Original file line number
Diff line number
Diff line change
@@ -3,4 +3,4 @@
3
3
////var a: Array<string> | Array<number>;
4
4
////a./*1*/length
5
5
6
-
verify.quickInfoAt("1","(property) Array<T>.length: number","Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.");
6
+
verify.quickInfoAt("1","(property) Array<T>.length: number","Gets or sets the length of the array. This is a number one higher than the highest index in the array.");
0 commit comments