CS3 JS: Function

CS3 JavaScript

Function

 The Function class wraps a built-in or JavaScript function.

QuickLinks

Function, apply, call, toSource, toString

Properties

PropertyTypeAccessDescription
argumentsObjectr/w

The function arguments, packed into an array.

This property is deprecated; use the arguments property within the function body.

aritynumberreadonly

The number of formal arguments.

This property is deprecated; use the length property instead.

lengthnumberreadonly The number of formal arguments.
namestringreadonlyThe function name.

Methods

Function Function (arguments:string, body:string)

ParameterTypeDescription
argumentsstringThe list of formal arguments, separated by commas.
bodystringThe body of the function to create.

any apply (thisObj:Object, args:Array)
Apply a this object and an argument list to a function.

ParameterTypeDescription
thisObjObject
argsArrayAn array of arguments.

any call (thisObj:Object, argument:any)
Apply a this object and arguments to a function.

ParameterTypeDescription
thisObjObject
argument any

string toSource ()
Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with JavaScript functions.

string toString ()
Returns the function definition as a string.

Element of

Object.constructor

Used in

Array.sort (userFunction:Function)

Object.watch (name:string, func:Function)

Return

Function Function.Function (arguments:string, body:string)

Contents :: Index