User defined functions part 3

Calling a Function



To execute the function, you need to call it.
To call a function, start with the name of the function, then follow it with the arguments in parentheses.
Example:
function myFunction() {
alert("Calling a Function!");
}

myFunction();
//Alerts "Calling a Function!"
Try It Yourself

Always remember to end the statement with a semicolon after calling the function.
Fill in the blanks to define and call the "hello" function.

 
 
 Function hello() {
   alert("Hi there");
}
 
 
Hello ();

Comments

Popular posts from this blog

Introducing object part 3

Comparison Operators part 2

Module 2