HTML5 APPLICATIONS DEVELOPMENT MANUAL

(lu) #1

If the function was invoked from a statement, JavaScript will "return"


to execute the code after the invoking statement.


Functions often compute a return value. The return value is


"returned" back to the "caller":


<!DOCTYPE html>







JavaScript Functions


This example calls a function which performs a calculation and returns the result:






Variables


Scripts should temporarily store pieces of information. These bits of


data can be stored as variables.


It’s called a variable because its values can vary every time a program


is run. Variables can be defined using the var syntax with a unique keyword,


such as height or width.

Free download pdf