Skip to content

Commit

Permalink
Document indexOf return value when not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal-So committed Nov 23, 2024
1 parent d85767a commit ed3d7f7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions src/lib/es2020.bigint.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ interface BigInt64Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike>
includes(searchElement: bigint, fromIndex?: number): boolean;

/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -241,7 +241,7 @@ interface BigInt64Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike>
keys(): ArrayIterator<number>;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down Expand Up @@ -500,7 +500,7 @@ interface BigUint64Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike>
includes(searchElement: bigint, fromIndex?: number): boolean;

/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -518,7 +518,7 @@ interface BigUint64Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike>
keys(): ArrayIterator<number>;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down
40 changes: 20 additions & 20 deletions src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,14 @@ interface String {
concat(...strings: string[]): string;

/**
* Returns the position of the first occurrence of a substring.
* Returns the position of the first occurrence of a substring, or -1 if it is not present.
* @param searchString The substring to search for in the string
* @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
*/
indexOf(searchString: string, position?: number): number;

/**
* Returns the last occurrence of a substring in the string.
* Returns the last occurrence of a substring in the string, or -1 if it is not present.
* @param searchString The substring to search for.
* @param position The index at which to begin searching. If omitted, the search begins at the end of the string.
*/
Expand Down Expand Up @@ -1948,7 +1948,7 @@ interface Int8Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;

/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -1963,7 +1963,7 @@ interface Int8Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
join(separator?: string): string;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down Expand Up @@ -2229,7 +2229,7 @@ interface Uint8Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;

/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -2244,7 +2244,7 @@ interface Uint8Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
join(separator?: string): string;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down Expand Up @@ -2510,7 +2510,7 @@ interface Uint8ClampedArray<TArrayBuffer extends ArrayBufferLike = ArrayBufferLi
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;

/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -2525,7 +2525,7 @@ interface Uint8ClampedArray<TArrayBuffer extends ArrayBufferLike = ArrayBufferLi
join(separator?: string): string;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down Expand Up @@ -2790,7 +2790,7 @@ interface Int16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
*/
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -2805,7 +2805,7 @@ interface Int16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
join(separator?: string): string;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down Expand Up @@ -3071,7 +3071,7 @@ interface Uint16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;

/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -3086,7 +3086,7 @@ interface Uint16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
join(separator?: string): string;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down Expand Up @@ -3351,7 +3351,7 @@ interface Int32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;

/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -3366,7 +3366,7 @@ interface Int32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
join(separator?: string): string;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down Expand Up @@ -3631,7 +3631,7 @@ interface Uint32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
*/
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -3646,7 +3646,7 @@ interface Uint32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
join(separator?: string): string;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down Expand Up @@ -3912,7 +3912,7 @@ interface Float32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;

/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -3927,7 +3927,7 @@ interface Float32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
join(separator?: string): string;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down Expand Up @@ -4193,7 +4193,7 @@ interface Float64Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;

/**
* Returns the index of the first occurrence of a value in an array.
* Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand All @@ -4208,7 +4208,7 @@ interface Float64Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
join(separator?: string): string;

/**
* Returns the index of the last occurrence of a value in an array.
* Returns the index of the last occurrence of a value in an array, or -1 if it is not present.
* @param searchElement The value to locate in the array.
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
* search starts at index 0.
Expand Down

0 comments on commit ed3d7f7

Please sign in to comment.