HTML and CSS Reference
Figure 7.22 Example of output for Example 7.13.
Functions are fundamental to programming in any programming language. There are
there are user-defined functions. This chapter was all about defining and calling your
own functions. We will be creating functions throughout the rest of this text to perform
tasks based on user-initiated events such as clicking a link, clicking a button, rolling a
code or from another file. They may be used to create objects, respond to HTTP requests,
validate data, perform calculations, customize output, and so on. After reading this
chapter, you should know:
1. How to declare and define functions.
3. How to call a function with arguments and use parameters.
4. What can be returned from a function.
5. The difference between global and local variables.
6. How to trigger a function call.
7. How to assign a function to a variable.
8. What closure is.
9. What recursion is.
10. How try and catch work.
11. How to debug programs with browser tools.