June 2014
Intermediate to advanced
696 pages
38h 52m
English
You define a function by using the function keyword followed by a name that describes the use of the function, a list of zero or more arguments in (), and a block of one or more code statements in {}. For example, the following is a function definition that writes "Hello World" to the console:
function myFunction(){ console.log("Hello World");}
To execute the code in myFunction(), all you need to do is add the following line to the main JavaScript or inside another function:
myFunction();
Read now
Unlock full access