prototype[@@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.prototype.toString()

The **` toString() ` ** method of [ ` Function ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Function) instances returns a
string representing the source code of this function.

##  Try it

##  Syntax

js

    
    
    toString()
    

###  Parameters

None.

###  Return value

A string representing the source code of the function.

##  Description

The [ ` Function ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Function) object overrides the
` toString() ` method inherited from [ ` Object ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Object) ; it does not inherit
[ ` Object.prototype.toString ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString) . For user-
defined ` Function ` objects, the ` toString ` method returns a string
containing the source text segment which was used to define the function.

JavaScript calls the ` toString ` method automatically when a ` Function ` is
to be represented as a text value, e.g. when a function is concatenated with a
string.

The ` toString() ` method will throw a [ ` TypeError ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) exception
("Function.prototype.toString called on incompatible object"), if its ` this `
value object is not a ` Function ` object.

js

    
    
    Function.prototype.toString.call("foo"); // throws TypeError
    

If the ` toString() ` method is called on built-in function objects, a
function created by [ ` Function.prototype.bind() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) , or other non-
JavaScript functions, then ` toSt