Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document indexOf return value when not found #60569

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading