Application of Functions in JavaScript

Function in programming is a mechanism used to group programs in solving a particular case, process or arithmetic formula. In the same sense the grouping of codes is also often called a subprogram (program part), procedure or method. In javascript it is all called functions, because Javascript only provides one keyword to make this function, namely the function
Function naming rules follow variable naming rules. The shape of the function block is as follows

Function with return value
A function with a return value is a function that has a return value. The return value here means that the value of the results of operations carried out in the function are given to other program parts for further processing. Return value in javascript is expressed by using the return keyword. The case example is in the area and volume calculator program. Where in the volume calculation there is also an extensive calculation included in it.
Function without return value
Is a function that has no return value or function that does not have the word "return".
Javascript Default Library

  • Math Object
  • String Object
  • Array Object
Recursive Function
The Recursive function is a function that calls itself
Experiment, make the web page as follows
Save the file as function1.html
Reverse Value Functions Make the web page as follows

Save with the name value Reverse.html
Functions without return value Make a web page as follows
Save with a name without Reverse Value.html
The Math Object Make the web page as follows
Save as math.html
String Object Make the web page as follows
Save as string.html
Array Objects Make web pages as follows
Save as array.html
Recursive Make a web page as follows
Save with the name rekurif.html

0 Response to "Application of Functions in JavaScript"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel