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

    Creates a new function.

    interface Function {
        arguments: any;
        caller: Function;
        length: number;
        name: string;
        prototype: any;
        "[hasInstance]"(value: any): boolean;
        "[hasInstance]"(value: any): boolean;
        apply(this: Function, thisArg: any, argArray?: any): any;
        apply(this: Function, thisArg: any, argArray?: any): any;
        bind(this: Function, thisArg: any, ...argArray: any[]): any;
        bind(this: Function, thisArg: any, ...argArray: any[]): any;
        call(this: Function, thisArg: any, ...argArray: any[]): any;
        call(this: Function, thisArg: any, ...argArray: any[]): any;
        toString(): string;
        toString(): string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    arguments: any

    传递给函数的参数。

    The arguments passed to a function. @non-standard

    caller: Function

    调用当前函数的函数。

    The function that invoked the current function. @non-standard

    length: number

    函数期望的参数个数。

    The number of arguments expected by the function.

    name: string

    Returns the name of the function. Function names are read-only and can not be changed.

    prototype: any

    函数的原型。

    The prototype of a function.

    Methods

    • Determines whether the given value inherits from this function if this function was used as a constructor function.

      A constructor function can control which objects are recognized as its instances by 'instanceof' by overriding this method.

      Parameters

      • value: any

      Returns boolean

    • Parameters

      • value: any

      Returns boolean

      如果此函数用作构造函数,则确定给定值是否继承自此函数。

      Determines whether the given value inherits from this function if this function was used as a constructor function.

      构造函数可以通过重写此方法来控制哪些对象被 'instanceof' 识别为其-实例。

      A constructor function can control which objects are recognized as its instances by 'instanceof' by overriding this method.

    • Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.

      Parameters

      • this: Function
      • thisArg: any

        The object to be used as the this object.

      • OptionalargArray: any

        A set of arguments to be passed to the function.

      Returns any

    • Parameters

      • this: Function
      • thisArg: any
      • OptionalargArray: any

      Returns any

      调用函数,用指定的对象替换函数的 this 值,用指定的数组替换函数的参数。

      Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要传递给函数的一组参数。

      A set of arguments to be passed to the function.

    • For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      Parameters

      • this: Function
      • thisArg: any

        An object to which the this keyword can refer inside the new function.

      • ...argArray: any[]

        A list of arguments to be passed to the new function.

      Returns any

    • Parameters

      • this: Function
      • thisArg: any
      • ...argArray: any[]

      Returns any

      对于给定的函数,创建一个绑定函数,其主体与原始函数相同。

      For a given function, creates a bound function that has the same body as the original function.

      绑定函数的 this 对象与指定的对象相关联,并具有指定的初始参数。

      The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      this 关键字在新函数内部可以引用的对象。

      An object to which the this keyword can refer inside the new function.

      要传递给新函数的参数列表。

      A list of arguments to be passed to the new function.

    • Calls a method of an object, substituting another object for the current object.

      Parameters

      • this: Function
      • thisArg: any

        The object to be used as the current object.

      • ...argArray: any[]

        A list of arguments to be passed to the method.

      Returns any

    • Parameters

      • this: Function
      • thisArg: any
      • ...argArray: any[]

      Returns any

      调用对象的方法,用另一个对象替换当前对象。

      Calls a method of an object, substituting another object for the current object.

      将用作当前对象的对象。

      The object to be used as the current object.

      要传递给方法的参数列表。

      A list of arguments to be passed to the method.

    • Returns a string representation of a function.

      Returns string

    • Returns string

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

      Returns a string representation of a function.