Function name Property
Description
The name property returns the name of a function.
Example
// Create Functions
function fn1() {};
function fn2(a, b, c) {};
// Get Function names
let text = fn1.name + " " + fn2.name;
Try it Yourself »
Syntax
function.name
Parameters
| NONE |
Return Value
| Type | Description |
| Number | The name of the function. |
JavaScript Function Methods
Browser Support
function.name is an ECMAScript1 (JavaScript 1997) feature.
It is supported in all browsers:
| Chrome | Edge | Firefox | Safari | Opera |