VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-function-name-property/

⇱ JavaScript Function name Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript Function name Property

Last Updated : 22 Jan, 2026

In JavaScript, functions are objects and come with built-in properties. The name property is used to identify a function by returning the name assigned at the time of its creation.

  • Function.name returns the original name of the function.
  • The name property is read-only and cannot be modified.
  • It is useful for debugging, logging, and stack traces.

Syntax:

Function.name

Property Values: This property has three attributes as mentioned below:

  • Writable: No
  • readable: No
  • configurable: Yes

Return Value: This property returns the string i.e the name of the function.

Example: Below is a Basic example of the Function name Property.

More examples for the above property are provided below:

[Example 1]: When the simple function is given

[Example 2]: When an object of function is given.

[Example 3]: Using the name property on an instance of the function.

[Example 4]: Using the name property on the bounded function.

Comment