O'Reilly logo

JavaScript A Beginners Guide 4/E by John Pollock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4
Using Functions
Key Skills & Concepts
    What a Function Is
    Why Functions Are Useful
    Structuring Functions
    Calling Functions in Your Scripts
image
As a JavaScript coder, you need to know how to use functions in your scripts. Functions can make your scripts more portable and easier to debug.
This chapter covers the basics of using functions. First, you will find out what a function is and why functions are useful. Then, you will learn how to define and structure functions. Finally, you will learn how to call functions in your scripts.
What a Function Is
A function is basically a little script within a larger script. Its purpose ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required