| return This statement is used to stop and exit the execution of the current function, and can be any valid JavaScript data type, the most common being true or false. It should be noted that when a return statement is included in a loop or a branched execution structure, there should be a return statement for each branch of the tree. This also includes a default return statement for the end executable within the tree. syntax: return value; EXAMPLE function fetchValue() { var valueOne = "456"; return valueOne; } This example describes how to return the value '456' within a function. The value's name is 'valueOne', as specified by declaring the local variable 'var valueOne = "456" '. The value '456' may also be a variable that is the product of another function. |