bhylu.com

Advertisements

Function Invocation

Invoke a function by writing its name followed by parentheses. The expression inside becomes an argument.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

function square(value) {
  return value * value;
}
const answer = square(5);
console.log(answer);

What happens

The call evaluates to 25.