Function: name - JavaScript | MDN

developer.mozilla.org

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

Object.defineProperty()

The function's name property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself.

Default-exported function declaration

An export default declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is "default".

Function constructor

Functions created with the Function() constructor have name "anonymous".

Initializer and default value

Functions in initializers (default values) of destructuring, default parameters, class fields, etc., will inherit the name of the bound identifier as their name.

default parameters

Functions in initializers (default values) of destructuring, default parameters, class fields, etc., will inherit the name of the bound identifier as their name.

Initializer and default value

Functions in initializers (default values) of destructuring, default parameters, class fields, etc., will inherit the name of the bound identifier as their name.

Function.prototype.bind()

Function.prototype.bind() produces a function whose name is "bound " plus the function name.

Symbol as function name

If a Symbol is used a function name and the symbol has a description, the method's name is the description in square brackets.

Learn how to contribute

This page was last modified on Jul 10, 2025 by MDN contributors.

[Symbol.hasInstance]()

__defineGetter__()

__defineSetter__()

__lookupGetter__()

__lookupSetter__()

propertyIsEnumerable()

Community resources