Open In App

JavaScript Function name Property

Last Updated : 15 Jul, 2025
Comments
Improve
Suggest changes
6 Likes
Like
Report

The function name property of the javascript object is used to return the name of the function. This name property of the function is only readable and cannot be altered. The name of the function which was given when the function was created is returned by Function.name.

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.

Output:

func1

More examples for the above property are provided below:

Example 1: When the simple function is given

Output:

Name of the function func2 is: func1
Name of the function func2 is: func2
Type of func.name is: string

Example 2: When an object of function is given.

Output:

Name of the function function1 is: functionName1
Name of the function function3 is: function3

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

Output:

obj[object Object]is an instance of function func

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

Output:

Name of the bounded func is: bound func

We have a complete list of Javascript Function methods, to check those please go through this Javascript Function Complete reference article.

Supported Browsers: 

  • Google Chrome 15 and above
  • Firefox 1 and above
  • Safari 6 and above
  • Microsoft Edge 14 and above
  • Opera 10.5 and above

Similar Reads