This chapter introduces you to the basics of functions and the advantages that they provide. First, you will be shown the different types of methods used for creating functions in JavaScript. Then, you will see how to define functions that return values to the calling program as well as how to specify parameters (arguments) for the defined function.
Functions: An Overview
A function may be simply defined as a set of statements or a subprogram that can be used or called anywhere within the JS program. A function typically has a name, but does not have to have a name, in which case it is called an ...