Function

@native @JSType trait Function extends StObject

Creates a new function.

trait StObject
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

@JSName("apply")
def apply(thisArg: Any): Any

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

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

Value Params
argArray

A set of arguments to be passed to the function.

thisArg

The object to be used as the this object.

@JSName("apply")
def apply(thisArg: Any, argArray: Any): Any
def bind(thisArg: Any, argArray: Any*): Any

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.

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.

Value Params
argArray

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

thisArg

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

def call(thisArg: Any, argArray: Any*): Any

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

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

Value Params
argArray

A list of arguments to be passed to the method.

thisArg

The object to be used as the current object.

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from
Object
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def toLocaleString(): String
Inherited from
Object
def valueOf(): Any
Inherited from
Object

Concrete fields

var arguments: Any
var caller: Function
@JSName
var hasInstance: Function1[Any, Boolean]

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

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.

val length: Double
val name: String

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

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