Below is a Basic example of Function name Property.
Property Values: This property has three attributes as mentioned below:
- Writable: No
- readable: No
- configurable: Yes
Returns: This property returns the string i.e the name of the function.
Code for the above property is provided below:
Program 1: When the simple function is given
Name of the function func2 is: func1 Name of the function func2 is: func2 Type of func.name is: string
Program 2: When an object of function is given.
Name of the function function1 is: functionName1 Name of the function function3 is: function3
Program 3: Using the name property on an instance of the function.
obj[object Object]is an instance of function func
Program 4: Using the name property on the bounded function.
Name of the bounded func is: bound func
- Google Chrome
- Internet Explorer
- Microsoft Edge
- How to get the function name inside a function in PHP ?
- CSS | animation-name Property
- HTML | DOM name Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Akanksha_Rai