Function() (Function)

A Function object constructor.

Availability:

ECMAScript edition - 2
JavaScript - 1.1
JScript - 1.0
Internet Explorer - 3.02
Netscape - 3.0
Property/method value type:Function object
JavaScript syntax:-Function()
-Function(someArguments)
Argument list:someArgumentsSome formal parameters and a block of script source

When the Function constructor is called as a function, it creates and initializes a new function object. The function call Function() is equivalent to the expression new Function() with the same arguments.

The arguments supplied to the Function() constructor are all assumed to be parameters apart from the last one which is taken to be the body Source Script Text. If there is only one argument, then that is taken to be the body of the function.

See also:Cast operator, Constructor function, constructor property, Function call, Function.prototype, Implicit conversion

Cross-references:

ECMA 262 edition 2 - section - 15.1.3.2

ECMA 262 edition 2 - section - 15.3.1

ECMA 262 edition 2 - section - 15.3.2.1

ECMA 262 edition 2 - section - 15.3.4.1

ECMA 262 edition 3 - section - 15.3.1