Skip to Main Content
JavaScript: A Beginner's Guide, Fifth Edition, 5th Edition
book

JavaScript: A Beginner's Guide, Fifth Edition, 5th Edition

by John Pollock
November 2019
Beginner content levelBeginner
560 pages
13h 36m
English
McGraw-Hill
Content preview from JavaScript: A Beginner's Guide, Fifth Edition, 5th Edition

Chapter 4

Using Functions

Key Skills & Concepts

   What a Function Is

   Why Functions Are Useful

   Structuring Functions

   Calling Functions in Your Scripts

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 is to perform a single task or a series of tasks. What a function does depends on what code you place ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Javascript Absolute Beginner's Guide, 3rd Edition

Javascript Absolute Beginner's Guide, 3rd Edition

Kirupa Chinnathambi
JavaScript Cookbook, 3rd Edition

JavaScript Cookbook, 3rd Edition

Adam D. Scott, Matthew MacDonald, Shelley Powers

Publisher Resources

ISBN: 9781260457698