User defined functions part 2

Defining a Function



To define a JavaScript function, use the function keyword, followed by a name, followed by a set of parentheses ().

The code to be executed by the function is placed inside curly brackets {}.function name() {
//code to be executed
}

Function names can contain letters, digits, underscores, and dollar signs (same rules as variables).
Add the corresponding keyword and symbols to create a function named "test".

 
 
 Function test() 
 
 

{   /* some code */}
 
 

Comments

Popular posts from this blog

Introducing object part 3

Comparison Operators part 2

Module 2