How to call a function

A function is called by specifying the name of the function followed by parentheses and…

In JavaScript, how do you call a function?

A function is called by specifying the name of the function followed by parentheses and passing any required arguments.

// calling a fuction without passing arguments
sayHello();
// calling a function and passing arguments
let sum = add(5,12);

Level: Apprentice · More JavaScript terms at this level

Updated