JavaScript Function call()

Method Reuse

With the call() method, you can write a method that can be used on different objects.

All Functions are Methods

In JavaScript all functions are object methods.

If a function is not a method of a JavaScript object, it is a function of the global object (see previous chapter).

The example below creates an object with 3 properties, firstName, lastName, fullName. Continue reading JavaScript Function call()

JavaScript Function Invocation

The code inside a JavaScript function will execute when “something” invokes it.

Invoking a JavaScript Function

The code inside a function is not executed when the function is defined.

The code inside a function is executed when the function is invoked.

It is common to use the term “call a function” instead of “invoke a function“.

It is also common to say “call upon a function”, “start a function”, or “execute a function”.

In this tutorial, we will use invoke, because a JavaScript function can be invoked without being called. Continue reading JavaScript Function Invocation