JavaScript named function

Last Updated Jul 29, 2015, 07:00:14 PM

JavaScript named function

A named function is a function with a function name:

Named functions can be either declared in a statement or used in an expression. Named function expressions create readable stack traces. The name of the function is bound inside its body, and that can be useful. And we can use the name to have a function invoke itself, or to access its properties like any other object.

Try It Now

Declaring a named function binds the function to the name in its surrounding environment

We can declare a named function anywhere, and its binding can be used everywhere.

Other JavaScript functions you might want to learn

JavaScript functions

JavaScript functions with paramters

JavaScript Anonymous functions

JavaScript Inner functions

JavaScript Recursive functions

Sources and Credits

The source of the content has been referred and updated with Mozilla Developer Network and W3C Organization

Last Updated Jul 29, 2015, 07:00:14 PM

Browser compatibility

Basic support Yes Yes Yes Yes Yes Yes Yes