Javatpoint Logo
Javatpoint Logo

JavaScript Function bind() method

The JavaScript Function bind() method is used to create a new function. When a function is called, it has its own this keyword set to the provided value, with a given sequence of arguments.

Syntax

Parameter

thisArg - The this value passed to the target function.

arg1,arg2,....,argn - It represents the arguments for the function.

Return Value

It returns the replica of the given function along provided this value and initial arguments.

JavaScript Function bind() method Example

Example 1

Let's see a simple example of bind() method.

Test it Now

Output:

Javatpoint

Example 2

Let's see an example of bind() method.

Test it Now

Output:

Javatpoint Oracle Javatpoint





Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA