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".
{ /* some code */}
Comments
Post a Comment