otype[@@hasInstance]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/@@hasInstance)
    2. [ ` Function.prototype.apply() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply)
    3. [ ` Function.prototype.bind() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind)
    4. [ ` Function.prototype.call() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call)
    5. [ ` Function.prototype.toString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/toString)
  6. **Inheritance**
  7. **[ ` Object ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) **
  8. Properties 
    1. [ ` Object.prototype.constructor ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor)
    2. [ ` Object.prototype.__proto__ ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto) Deprecated 
  9. Methods 
    1. [ ` Object.prototype.__defineGetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__) Deprecated 
    2. [ ` Object.prototype.__defineSetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__) Deprecated 
    3. [ ` Object.prototype.__lookupGetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__) Deprecated 
    4. [ ` Object.prototype.__lookupSetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__) Deprecated 
    5. [ ` Object.prototype.hasOwnProperty() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)
    6. [ ` Object.prototype.isPrototypeOf() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf)
    7. [ ` Object.prototype.propertyIsEnumerable() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable)
    8. [ ` Object.prototype.toLocaleString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toLocaleString)
    9. [ ` Object.prototype.toString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString)
    10. [ ` Object.prototype.valueOf() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)

##  In this article

  * Try it 
  * Syntax 
  * Description 
  * Examples 
  * Specifications 
  * Browser compatibility 
  * See also 

#  Function() constructor

The **` Function() ` ** constructor creates [ ` Function ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Function) objects. Calling the
constructor directly can create functions dynamically, but suffers from
security and similar (but far less significant) performance issues as [ `
eval() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) .
However, unlike ` eval ` (which may have access to the local scope), the `
Function ` constructor creates functions which execute in the global scope
only.

##  Try it

##  Syntax

js

    
    
    new Function(functionBody)
    new Function(arg1, functionBody)
    new Function(arg1, arg2, functionBody)
    new Function(arg1, arg2, /* â¦, */ argN, functionBody)
    
    Function(functionBody)
    Function(arg1, functionBody)
    Function(arg1, arg2, functionBody)
    Function(arg1, arg2, /* â¦, */ argN, functionBody)
    

**Note:** ` Function() ` can be called with or without [ ` new ` ](/en-
US/docs/Web/JavaScript/Reference/Operators/new) . Both create a new ` Function
` instance.

###  Parameters

` arg1 ` , â¦, ` argN ` Optional

    

Names to be used by the function as formal argument names. Each must be a
string that corresponds to a valid JavaScript parameter (any of plain [
identifier ](/en-US/docs/Glossary/Identifier) , [ rest parameter ](/en-
US/docs/Web/JavaScript/Reference/Functions/rest_parameters) , or [
destructured ](/en-
US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)
parameter, optionally with a [ default ](/en-
US/docs/Web/JavaScript/Reference/Functions/Default_parameters) ), or a list of
such strings