Function()

JavaScript 1.0+, ECMAScript 1.0+, JScript 1.0+ Nav2+, NES2+, IE 3+, Opera3+ Syntax

var variable = new Function()
var variable = new Function(int)
var variable = new Function(arg1, …, argN)

Description

Function() is a constructor that creates a Function object. Table 6.26 lists the different methods and properties of the Function object.

Table 6.26. Properties and Methods of the Function Object
Property/Method Description
apply() Applies method to multiple objects
arguments Array reflecting function arguments
arity Number of arguments expected by function
call() Allows calling of methods belonging to other functions
caller Reference to function caller
prototype Prototype for a class of objects
toSource() Created copy of function ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.