Function - 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

Function.prototype.arguments

Represents the arguments passed to this function. For strict, arrow, async, and generator functions, accessing the arguments property throws a TypeError. Use the arguments object inside function closures instead.

Function.prototype.caller

Represents the arguments passed to this function. For strict, arrow, async, and generator functions, accessing the arguments property throws a TypeError. Use the arguments object inside function closures instead.

Function.prototype.constructor

Represents the arguments passed to this function. For strict, arrow, async, and generator functions, accessing the arguments property throws a TypeError. Use the arguments object inside function closures instead.

Function.prototype.apply()

Calls a function with a given this value and optional arguments provided as an array (or an array-like object).

Function.prototype.bind()

Calls a function with a given this value and optional arguments provided as an array (or an array-like object).

Function.prototype.call()

Calls a function with a given this value and optional arguments provided as an array (or an array-like object).

Function.prototype.toString()

Calls a function with a given this value and optional arguments provided as an array (or an array-like object).

Object.prototype.toString

Returns a string representing the source code of the function. Overrides the Object.prototype.toString method.

Function.prototype[Symbol.hasInstance]()

Calls a function with a given this value and optional arguments provided as an array (or an array-like object).

Difference between Function constructor and function declaration

Functions created with the Function constructor do not create closures to their creation contexts; they always are created in the global scope. When running them, they will only be able to access their own local variable

function expression

AsyncGeneratorFunction

Learn how to contribute

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

__defineGetter__()

__defineSetter__()

__lookupGetter__()