Calling Functions

Calling a Function

inline

  • Calling a function means you are using the function (as opposed to defining a function which only tells us what the function can do)

  • To call a function you simply write function name followed by parentheses (don’t forget the parentheses!)

  • Now you can call this function as many times as you want


// define / declare a function named shout()
// by itself this doesn't do anything, we must "Call" it
// in order to use it

function shout() {
  alert("HELLO!");
}


// Calling the function named shout
// we call a function by writing the name
// of the function followed by parentheses

shout();

JS Bin on jsbin.com