What is the use of functions in WMLScript?
What is the use of functions in WMLScript?
- The functions are used to combine the statements that can be executed together without writing it differently.
- Function declaration in WMLScript can be done using the statement as:
extern function identifier(FormatParameterList) Block ;
- The extern keyword that is used in the statement provide the function written outside and defined from outside only.
- The function can be given that consists of the parameters and written as mentioned like:
function RunTime(distance, speed) { var time = distance / speed; return time; };
- The return keyword that is used provides the value that needs to be returned to the function.