神岛 API 文档 - ArenaPro版
    Preparing search index...

    Interface TemplateStringsArray

    允许访问模板字面量的原始字符串形式。

    Allows access to the raw string form of template literals.

    interface TemplateStringsArray {
        length: number;
        raw: readonly string[];
        "[iterator]"(): ArrayIterator<string>;
        "[iterator]"(): IterableIterator<string>;
        concat(...items: ConcatArray<string>[]): string[];
        concat(...items: (string | ConcatArray<string>)[]): string[];
        concat(...items: ConcatArray<string>[]): string[];
        concat(...items: (string | ConcatArray<string>)[]): string[];
        entries(): ArrayIterator<[number, string]>;
        entries(): IterableIterator<[number, string]>;
        every<S extends string>(
            predicate: (
                value: string,
                index: number,
                array: readonly string[],
            ) => value is S,
            thisArg?: any,
        ): this is readonly S[];
        every(
            predicate: (
                value: string,
                index: number,
                array: readonly string[],
            ) => unknown,
            thisArg?: any,
        ): boolean;
        every<S extends string>(
            callbackfn: (
                value: string,
                index: number,
                array: readonly string[],
            ) => value is S,
            thisArg?: any,
        ): this is readonly S[];
        every(
            callbackfn: (
                value: string,
                index: number,
                array: readonly string[],
            ) => unknown,
            thisArg?: any,
        ): boolean;
        filter<S extends string>(
            predicate: (
                value: string,
                index: number,
                array: readonly string[],
            ) => value is S,
            thisArg?: any,
        ): S[];
        filter(
            predicate: (
                value: string,
                index: number,
                array: readonly string[],
            ) => unknown,
            thisArg?: any,
        ): string[];
        filter<S extends string>(
            callbackfn: (
                value: string,
                index: number,
                array: readonly string[],
            ) => value is S,
            thisArg?: any,
        ): S[];
        filter(
            callbackfn: (
                value: string,
                index: number,
                array: readonly string[],
            ) => unknown,
            thisArg?: any,
        ): string[];
        find<S extends string>(
            predicate: (
                value: string,
                index: number,
                obj: readonly string[],
            ) => value is S,
            thisArg?: any,
        ): S;
        find<S extends string>(
            predicate: (
                this: void,
                value: string,
                index: number,
                obj: readonly string[],
            ) => value is S,
            thisArg?: any,
        ): S;
        findIndex(
            predicate: (
                value: string,
                index: number,
                obj: readonly string[],
            ) => unknown,
            thisArg?: any,
        ): number;
        findIndex(
            predicate: (
                value: string,
                index: number,
                obj: readonly string[],
            ) => unknown,
            thisArg?: any,
        ): number;
        flat<A, D extends number = 1>(this: A, depth?: D): FlatArray<A, D>[];
        flat<U>(
            this:
                | readonly U[][][][][]
                | readonly (readonly U[][][][])[]
                | readonly (readonly U[][][])[][]
                | readonly (readonly U[][])[][][]
                | readonly (readonly U[])[][][][]
                | readonly (readonly (readonly U[][][])[])[]
                | readonly (readonly (readonly U[])[][][])[]
                | readonly (readonly (readonly U[])[])[][][]
                | readonly (readonly (readonly U[])[][])[][]
                | readonly (readonly (readonly U[][])[])[][]
                | readonly (readonly (readonly U[][])[][])[]
                | readonly (readonly (readonly (readonly U[][])[])[])[]
                | readonly (readonly (readonly (readonly U[])[][])[])[]
                | readonly (readonly (readonly (readonly U[])[])[][])[]
                | readonly (readonly (readonly (readonly U[])[])[])[][]
                | readonly (readonly (readonly (readonly (readonly U[])[])[])[])[],
            depth: 4,
        ): U[];
        flat<U>(
            this:
                | readonly U[][][][]
                | readonly (readonly U[])[][][]
                | readonly (readonly U[][])[][]
                | readonly (readonly U[][][])[]
                | readonly (readonly (readonly U[][])[])[]
                | readonly (readonly (readonly U[])[][])[]
                | readonly (readonly (readonly U[])[])[][]
                | readonly (readonly (readonly (readonly U[])[])[])[],
            depth: 3,
        ): U[];
        flat<U>(
            this:
                | readonly U[][][]
                | readonly (readonly U[][])[]
                | readonly (readonly U[])[][]
                | readonly (readonly (readonly U[])[])[],
            depth: 2,
        ): U[];
        flat<U>(this: readonly U[][] | readonly (readonly U[])[], depth?: 1): U[];
        flat<U>(this: readonly U[], depth: 0): U[];
        flat<U>(depth?: number): any[];
        flatMap<U, This = undefined>(
            callback: (
                this: This,
                value: string,
                index: number,
                array: string[],
            ) => U | readonly U[],
            thisArg?: This,
        ): U[];
        flatMap<U, This = undefined>(
            callback: (
                this: This,
                value: string,
                index: number,
                array: string[],
            ) => U | readonly U[],
            thisArg?: This,
        ): U[];
        forEach(
            callbackfn: (
                value: string,
                index: number,
                array: readonly string[],
            ) => void,
            thisArg?: any,
        ): void;
        forEach(
            callbackfn: (
                value: string,
                index: number,
                array: readonly string[],
            ) => void,
            thisArg?: any,
        ): void;
        includes(searchElement: string, fromIndex?: number): boolean;
        includes(searchElement: string, fromIndex?: number): boolean;
        indexOf(searchElement: string, fromIndex?: number): number;
        indexOf(searchElement: string, fromIndex?: number): number;
        join(separator?: string): string;
        join(separator?: string): string;
        keys(): ArrayIterator<number>;
        keys(): IterableIterator<number>;
        lastIndexOf(searchElement: string, fromIndex?: number): number;
        lastIndexOf(searchElement: string, fromIndex?: number): number;
        map<U>(
            callbackfn: (
                value: string,
                index: number,
                array: readonly string[],
            ) => U,
            thisArg?: any,
        ): U[];
        map<U>(
            callbackfn: (
                value: string,
                index: number,
                array: readonly string[],
            ) => U,
            thisArg?: any,
        ): U[];
        reduce(
            callbackfn: (
                previousValue: string,
                currentValue: string,
                currentIndex: number,
                array: readonly string[],
            ) => string,
        ): string;
        reduce<U>(
            callbackfn: (
                previousValue: U,
                currentValue: string,
                currentIndex: number,
                array: readonly string[],
            ) => U,
            initialValue: U,
        ): U;
        reduce(
            callbackfn: (
                previousValue: string,
                currentValue: string,
                currentIndex: number,
                array: readonly string[],
            ) => string,
        ): string;
        reduce<U>(
            callbackfn: (
                previousValue: U,
                currentValue: string,
                currentIndex: number,
                array: readonly string[],
            ) => U,
            initialValue: U,
        ): U;
        reduceRight(
            callbackfn: (
                previousValue: string,
                currentValue: string,
                currentIndex: number,
                array: readonly string[],
            ) => string,
        ): string;
        reduceRight<U>(
            callbackfn: (
                previousValue: U,
                currentValue: string,
                currentIndex: number,
                array: readonly string[],
            ) => U,
            initialValue: U,
        ): U;
        reduceRight(
            callbackfn: (
                previousValue: string,
                currentValue: string,
                currentIndex: number,
                array: readonly string[],
            ) => string,
        ): string;
        reduceRight<U>(
            callbackfn: (
                previousValue: U,
                currentValue: string,
                currentIndex: number,
                array: readonly string[],
            ) => U,
            initialValue: U,
        ): U;
        slice(start?: number, end?: number): string[];
        slice(start?: number, end?: number): string[];
        some(
            predicate: (
                value: string,
                index: number,
                array: readonly string[],
            ) => unknown,
            thisArg?: any,
        ): boolean;
        some(
            callbackfn: (
                value: string,
                index: number,
                array: readonly string[],
            ) => unknown,
            thisArg?: any,
        ): boolean;
        toLocaleString(): string;
        toLocaleString(): string;
        toString(): string;
        toString(): string;
        values(): ArrayIterator<string>;
        values(): IterableIterator<string>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    length: number

    Gets the length of the array. This is a number one higher than the highest element defined in an array.

    raw: readonly string[]

    包含模板字符串中所有原始(即未处理)字符串的只读数组。

    A read-only array of raw strings that are interpolated with the expression values.

    Methods

    • Combines two or more arrays.

      Parameters

      • ...items: ConcatArray<string>[]

        Additional items to add to the end of array1.

      Returns string[]

    • Combines two or more arrays.

      Parameters

      • ...items: (string | ConcatArray<string>)[]

        Additional items to add to the end of array1.

      Returns string[]

    • Parameters

      • ...items: ConcatArray<string>[]

      Returns string[]

      合并两个或多个数组。此方法不会更改现有数组,而是返回一个新数组。

      Combines two or more arrays. This method does not change the existing arrays, but instead returns a new array.

      要添加到数组末尾的其他数组和/或值。

      Additional arrays and/or items to add to the end of the array.

    • Parameters

      • ...items: (string | ConcatArray<string>)[]

      Returns string[]

      合并两个或多个数组。此方法不会更改现有数组,而是返回一个新数组。

      Combines two or more arrays. This method does not change the existing arrays, but instead returns a new array.

      要添加到数组末尾的其他数组和/或值。

      Additional arrays and/or items to add to the end of the array.

    • Returns an iterable of key, value pairs for every entry in the array

      Returns ArrayIterator<[number, string]>

    • Returns IterableIterator<[number, string]>

      返回一个可迭代对象,其中包含数组中每个条目的键/值对。

      Returns an iterable of key, value pairs for every entry in the array.

    • Determines whether all the members of an array satisfy the specified test.

      Type Parameters

      • S extends string

      Parameters

      • predicate: (value: string, index: number, array: readonly string[]) => value is S

        A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      Returns this is readonly S[]

    • Determines whether all the members of an array satisfy the specified test.

      Parameters

      • predicate: (value: string, index: number, array: readonly string[]) => unknown

        A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      Returns boolean

    • Type Parameters

      • S extends string

      Parameters

      • callbackfn: (value: string, index: number, array: readonly string[]) => value is S
      • OptionalthisArg: any

      Returns this is readonly S[]

      判断数组中的所有成员是否都满足指定的测试。

      Determines whether all the members of an array satisfy the specified test.

      一个接受最多三个参数的函数。 every 方法为数组中的每个元素调用 callbackfn 函数,直到 callbackfn 返回一个可强制转换为布尔值 false 的值,或者直到数组的末尾。

      A function that accepts up to three arguments. The every method calls the callbackfn function for each element in the array until the callbackfn returns a value which is coercible to the Boolean value false, or until the end of the array.

      一个对象,在 callbackfn 函数中可以作为 this 关键字引用。如果省略 thisArg,则使用 undefined 作为 this 值。

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    • Parameters

      • callbackfn: (value: string, index: number, array: readonly string[]) => unknown
      • OptionalthisArg: any

      Returns boolean

      判断数组中的所有成员是否都满足指定的测试。

      Determines whether all the members of an array satisfy the specified test.

      一个接受最多三个参数的函数。 every 方法为数组中的每个元素调用 callbackfn 函数,直到 callbackfn 返回一个可强制转换为布尔值 false 的值,或者直到数组的末尾。

      A function that accepts up to three arguments. The every method calls the callbackfn function for each element in the array until the callbackfn returns a value which is coercible to the Boolean value false, or until the end of the array.

      一个对象,在 callbackfn 函数中可以作为 this 关键字引用。如果省略 thisArg,则使用 undefined 作为 this 值。

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    • Returns the elements of an array that meet the condition specified in a callback function.

      Type Parameters

      • S extends string

      Parameters

      • predicate: (value: string, index: number, array: readonly string[]) => value is S

        A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      Returns S[]

    • Returns the elements of an array that meet the condition specified in a callback function.

      Parameters

      • predicate: (value: string, index: number, array: readonly string[]) => unknown

        A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      Returns string[]

    • Type Parameters

      • S extends string

      Parameters

      • callbackfn: (value: string, index: number, array: readonly string[]) => value is S
      • OptionalthisArg: any

      Returns S[]

      返回数组中满足回调函数中指定条件的元素。

      Returns the elements of an array that meet the condition specified in a callback function.

      一个接受最多三个参数的函数。 filter 方法为数组中的每个元素调用一次 callbackfn 函数。

      A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.

      一个对象,在 callbackfn 函数中可以作为 this 关键字引用。如果省略 thisArg,则使用 undefined 作为 this 值。

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    • Parameters

      • callbackfn: (value: string, index: number, array: readonly string[]) => unknown
      • OptionalthisArg: any

      Returns string[]

      返回数组中满足回调函数中指定条件的元素。

      Returns the elements of an array that meet the condition specified in a callback function.

      一个接受最多三个参数的函数。 filter 方法为数组中的每个元素调用一次 callbackfn 函数。

      A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.

      一个对象,在 callbackfn 函数中可以作为 this 关键字引用。如果省略 thisArg,则使用 undefined 作为 this 值。

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    • Returns the value of the first element in the array where predicate is true, and undefined otherwise.

      Type Parameters

      • S extends string

      Parameters

      • predicate: (value: string, index: number, obj: readonly string[]) => value is S

        find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns S

    • Type Parameters

      • S extends string

      Parameters

      • predicate: (this: void, value: string, index: number, obj: readonly string[]) => value is S
      • OptionalthisArg: any

      Returns S

      返回数组中第一个满足 predicate 函数的元素的值,否则返回 undefined。

      Returns the value of the first element in the array where predicate is true, and undefined otherwise.

      find 为数组中的每个元素(按升序)调用一次 predicate 函数,直到找到一个 predicate 返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。

      find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.

      如果提供,它将用作每次调用 predicate 时的 this 值。如果未提供,则使用 undefined。

      If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

    • Returns the index of the first element in the array where predicate is true, and -1 otherwise.

      Parameters

      • predicate: (value: string, index: number, obj: readonly string[]) => unknown

        find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns number

    • Parameters

      • predicate: (value: string, index: number, obj: readonly string[]) => unknown
      • OptionalthisArg: any

      Returns number

      返回数组中第一个满足 predicate 函数的元素的索引,否则返回 -1。

      Returns the index of the first element in the array where predicate is true, and -1 otherwise.

      findIndex 为数组中的每个元素(按升序)调用一次 predicate 函数,直到找到一个 predicate 返回 true 的元素。如果找到这样的元素,findIndex 会立即返回该元素的索引。否则,findIndex 返回 -1。

      findIndex calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.

      如果提供,它将用作每次调用 predicate 时的 this 值。如果未提供,则使用 undefined。

      If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

    • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

      Type Parameters

      • A
      • D extends number = 1

      Parameters

      • this: A
      • Optionaldepth: D

        The maximum recursion depth

      Returns FlatArray<A, D>[]

    • Type Parameters

      • U

      Parameters

      • this:
            | readonly U[][][][][]
            | readonly (readonly U[][][][])[]
            | readonly (readonly U[][][])[][]
            | readonly (readonly U[][])[][][]
            | readonly (readonly U[])[][][][]
            | readonly (readonly (readonly U[][][])[])[]
            | readonly (readonly (readonly U[])[][][])[]
            | readonly (readonly (readonly U[])[])[][][]
            | readonly (readonly (readonly U[])[][])[][]
            | readonly (readonly (readonly U[][])[])[][]
            | readonly (readonly (readonly U[][])[][])[]
            | readonly (readonly (readonly (readonly U[][])[])[])[]
            | readonly (readonly (readonly (readonly U[])[][])[])[]
            | readonly (readonly (readonly (readonly U[])[])[][])[]
            | readonly (readonly (readonly (readonly U[])[])[])[][]
            | readonly (readonly (readonly (readonly (readonly U[])[])[])[])[]
      • depth: 4

      Returns U[]

      返回一个新数组,其中所有子数组元素递归地连接到指定深度。

      Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

      最大递归深度。

      The maximum recursion depth.

    • Type Parameters

      • U

      Parameters

      • this:
            | readonly U[][][][]
            | readonly (readonly U[])[][][]
            | readonly (readonly U[][])[][]
            | readonly (readonly U[][][])[]
            | readonly (readonly (readonly U[][])[])[]
            | readonly (readonly (readonly U[])[][])[]
            | readonly (readonly (readonly U[])[])[][]
            | readonly (readonly (readonly (readonly U[])[])[])[]
      • depth: 3

      Returns U[]

      返回一个新数组,其中所有子数组元素递归地连接到指定深度。

      Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

      最大递归深度。

      The maximum recursion depth.

    • Type Parameters

      • U

      Parameters

      • this:
            | readonly U[][][]
            | readonly (readonly U[][])[]
            | readonly (readonly U[])[][]
            | readonly (readonly (readonly U[])[])[]
      • depth: 2

      Returns U[]

      返回一个新数组,其中所有子数组元素递归地连接到指定深度。

      Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

      最大递归深度。

      The maximum recursion depth.

    • Type Parameters

      • U

      Parameters

      • this: readonly U[][] | readonly (readonly U[])[]
      • Optionaldepth: 1

      Returns U[]

      返回一个新数组,其中所有子数组元素递归地连接到指定深度。

      Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

      最大递归深度。

      The maximum recursion depth.

    • Type Parameters

      • U

      Parameters

      • this: readonly U[]
      • depth: 0

      Returns U[]

      返回一个新数组,其中所有子数组元素递归地连接到指定深度。

      Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

      最大递归深度。

      The maximum recursion depth.

    • Type Parameters

      • U

      Parameters

      • Optionaldepth: number

      Returns any[]

      返回一个新数组,其中所有子数组元素递归地连接到指定深度。如果未提供深度,flat 方法默认为深度 1。

      Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth. If no depth is provided, flat method defaults to the depth of 1.

      最大递归深度。

      The maximum recursion depth.

    • Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.

      Type Parameters

      • U
      • This = undefined

      Parameters

      • callback: (this: This, value: string, index: number, array: string[]) => U | readonly U[]

        A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array.

      • OptionalthisArg: This

        An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value.

      Returns U[]

    • Type Parameters

      • U
      • This = undefined

      Parameters

      • callback: (this: This, value: string, index: number, array: string[]) => U | readonly U[]
      • OptionalthisArg: This

      Returns U[]

      对数组中的每个元素调用定义的回调函数,然后将结果展平为新数组。 这等同于先进行 map 操作,然后进行深度为 1 的 flat 操作。

      Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.

      一个接受最多三个参数的函数。flatMap 方法对数组中的每个元素调用一次回调函数。

      A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array.

      一个对象,在回调函数中可以作为 this 关键字引用。如果省略 thisArg,则使用 undefined 作为 this 值。

      An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value.

    • Performs the specified action for each element in an array.

      Parameters

      • callbackfn: (value: string, index: number, array: readonly string[]) => void

        A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

      Returns void

    • Parameters

      • callbackfn: (value: string, index: number, array: readonly string[]) => void
      • OptionalthisArg: any

      Returns void

      对数组中的每个元素执行指定的操作。

      Performs the specified action for each element in an array.

      一个接受最多三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。

      A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

      一个对象,在 callbackfn 函数中可以作为 this 关键字引用。如果省略 thisArg,则使用 undefined 作为 this 值。

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    • Determines whether an array includes a certain element, returning true or false as appropriate.

      Parameters

      • searchElement: string

        The element to search for.

      • OptionalfromIndex: number

        The position in this array at which to begin searching for searchElement.

      Returns boolean

    • Parameters

      • searchElement: string
      • OptionalfromIndex: number

      Returns boolean

      判断一个数组是否包含一个指定的值,根据情况返回 true 或 false。

      Determines whether an array includes a certain element, returning true or false as appropriate.

      需要查找的元素值。

      The element to search for.

      从该索引处开始查找 searchElement。如果为负值,则按升序从 array.length + fromIndex 的索引开始搜索。

      The position in this array at which to begin searching for searchElement.

    • Returns the index of the first occurrence of a value in an array.

      Parameters

      • searchElement: string

        The value to locate in the array.

      • OptionalfromIndex: number

        The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

      Returns number

    • Parameters

      • searchElement: string
      • OptionalfromIndex: number

      Returns number

      返回数组中首次出现指定值的索引,如果未找到则返回 -1。

      Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

      要在数组中定位的值。

      The value to locate in the array.

      开始搜索的数组索引。如果省略 fromIndex,则从索引 0 开始搜索。

      The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

    • Adds all the elements of an array separated by the specified separator string.

      Parameters

      • Optionalseparator: string

        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.

      Returns string

    • Parameters

      • Optionalseparator: string

      Returns string

      将数组的所有元素连接成一个字符串,并用指定的分隔符分隔。

      Adds all the elements of an array into a string, separated by the specified separator string.

      一个字符串,用于分隔数组的每个元素。如果省略,数组元素用逗号分隔。

      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.

    • Returns the index of the last occurrence of a specified value in an array.

      Parameters

      • searchElement: string

        The value to locate in the array.

      • OptionalfromIndex: number

        The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.

      Returns number

    • Parameters

      • searchElement: string
      • OptionalfromIndex: number

      Returns number

      返回数组中最后一次出现指定值的索引,如果未找到则返回 -1。

      Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.

      要在数组中定位的值。

      The value to locate in the array.

      开始向前搜索的数组索引。如果省略 fromIndex,则从数组的最后一个索引开始搜索。

      The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.

    • Calls a defined callback function on each element of an array, and returns an array that contains the results.

      Type Parameters

      • U

      Parameters

      • callbackfn: (value: string, index: number, array: readonly string[]) => U

        A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

      Returns U[]

    • Type Parameters

      • U

      Parameters

      • callbackfn: (value: string, index: number, array: readonly string[]) => U
      • OptionalthisArg: any

      Returns U[]

      对数组中的每个元素调用定义的回调函数,并返回包含结果的数组。

      Calls a defined callback function on each element of an array, and returns an array that contains the results.

      一个接受最多三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。

      A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

      一个对象,在 callbackfn 函数中可以作为 this 关键字引用。如果省略 thisArg,则使用 undefined 作为 this 值。

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    • Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      Parameters

      • callbackfn: (
            previousValue: string,
            currentValue: string,
            currentIndex: number,
            array: readonly string[],
        ) => string

        A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

      Returns string

    • Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      Type Parameters

      • U

      Parameters

      • callbackfn: (
            previousValue: U,
            currentValue: string,
            currentIndex: number,
            array: readonly string[],
        ) => U

        A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

      • initialValue: U

        If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

      Returns U

    • Parameters

      • callbackfn: (
            previousValue: string,
            currentValue: string,
            currentIndex: number,
            array: readonly string[],
        ) => string

      Returns string

      对数组中的所有元素调用指定的回调函数。回调函数的返回值是累积的结果,并在下一次调用回调函数时作为参数提供。

      Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      一个接受最多四个参数的函数。 reduce 方法为数组中的每个元素调用一次 callbackfn 函数。

      A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

      如果指定了 initialValue,它将用作开始累积的初始值。第一次调用 callbackfn 函数时,此值将作为参数而不是数组值提供。

      If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

    • Type Parameters

      • U

      Parameters

      • callbackfn: (
            previousValue: U,
            currentValue: string,
            currentIndex: number,
            array: readonly string[],
        ) => U
      • initialValue: U

      Returns U

      对数组中的所有元素调用指定的回调函数。回调函数的返回值是累积的结果,并在下一次调用回调函数时作为参数提供。

      Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      一个接受最多四个参数的函数。 reduce 方法为数组中的每个元素调用一次 callbackfn 函数。

      A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

      如果指定了 initialValue,它将用作开始累积的初始值。第一次调用 callbackfn 函数时,此值将作为参数而不是数组值提供。

      If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

    • Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      Parameters

      • callbackfn: (
            previousValue: string,
            currentValue: string,
            currentIndex: number,
            array: readonly string[],
        ) => string

        A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

      Returns string

    • Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      Type Parameters

      • U

      Parameters

      • callbackfn: (
            previousValue: U,
            currentValue: string,
            currentIndex: number,
            array: readonly string[],
        ) => U

        A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

      • initialValue: U

        If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

      Returns U

    • Parameters

      • callbackfn: (
            previousValue: string,
            currentValue: string,
            currentIndex: number,
            array: readonly string[],
        ) => string

      Returns string

      对数组中的所有元素按降序调用指定的回调函数。回调函数的返回值是累积的结果,并在下一次调用回调函数时作为参数提供。

      Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      一个接受最多四个参数的函数。 reduceRight 方法为数组中的每个元素调用一次 callbackfn 函数。

      A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

      如果指定了 initialValue,它将用作开始累积的初始值。第一次调用 callbackfn 函数时,此值将作为参数而不是数组值提供。

      If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

    • Type Parameters

      • U

      Parameters

      • callbackfn: (
            previousValue: U,
            currentValue: string,
            currentIndex: number,
            array: readonly string[],
        ) => U
      • initialValue: U

      Returns U

      对数组中的所有元素按降序调用指定的回调函数。回调函数的返回值是累积的结果,并在下一次调用回调函数时作为参数提供。

      Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      一个接受最多四个参数的函数。 reduceRight 方法为数组中的每个元素调用一次 callbackfn 函数。

      A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

      如果指定了 initialValue,它将用作开始累积的初始值。第一次调用 callbackfn 函数时,此值将作为参数而不是数组值提供。

      If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

    • Returns a section of an array.

      Parameters

      • Optionalstart: number

        The beginning of the specified portion of the array.

      • Optionalend: number

        The end of the specified portion of the array. This is exclusive of the element at the index 'end'.

      Returns string[]

    • Parameters

      • Optionalstart: number
      • Optionalend: number

      Returns string[]

      返回数组的一部分。此方法不会更改原始数组。

      Returns a section of an array. This method does not change the original array.

      指定部分的开始位置。

      The beginning of the specified portion of the array.

      指定部分的结束位置。这是在索引 'end' 处的元素之前。

      The end of the specified portion of the array. This is exclusive of the element at the index 'end'.

    • Determines whether the specified callback function returns true for any element of an array.

      Parameters

      • predicate: (value: string, index: number, array: readonly string[]) => unknown

        A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      Returns boolean

    • Parameters

      • callbackfn: (value: string, index: number, array: readonly string[]) => unknown
      • OptionalthisArg: any

      Returns boolean

      判断数组中是否有任何元素满足指定的测试。

      Determines whether the specified callback function returns true for any element of an array.

      一个接受最多三个参数的函数。 some 方法为数组中的每个元素调用 callbackfn 函数,直到 callbackfn 返回一个可强制转换为布尔值 true 的值,或者直到数组的末尾。

      A function that accepts up to three arguments. The some method calls the callbackfn function for each element in the array until the callbackfn returns a value which is coercible to the Boolean value true, or until the end of the array.

      一个对象,在 callbackfn 函数中可以作为 this 关键字引用。如果省略 thisArg,则使用 undefined 作为 this 值。

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    • Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.

      Returns string

    • Returns string

      返回数组的本地化字符串表示形式。元素使用其 toLocaleString 方法转换为字符串。

      Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.

    • Returns a string representation of an array.

      Returns string

    • Returns string

      返回数组的字符串表示形式。

      Returns a string representation of an array.