O'Reilly logo

Internet & World Wide Web: How to Program, Fourth Edition by P. J. Deitel - Deitel & Associates, Inc., H. M. Deitel - Deitel & Associates, Inc.

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 9. JavaScript: Functions

 

Form ever follows function.

 
 --Louis Sullivan
 

E pluribus unum. (One composed of many.)

 
 --Virgil
 

O! call back yesterday, bid time return.

 
 --William Shakespeare
 

Call me Ishmael.

 
 --Herman Melville
 

When you call me that, smile.

 
 --Owen Wister

OBJECTIVES

In this chapter you will learn:

  • To construct programs modularly from small pieces called functions.

  • To create new functions.

  • How to pass information between functions.

  • Simulation techniques that use random number generation.

  • How the visibility of identifiers is limited to specific regions of programs.

Outline

9.1

Introduction

9.2

Program Modules in JavaScript

9.3

Programmer-Defined Functions

9.4

Function Definitions

9.5

Random Number Generation

9.6

Example: Game of Chance

9.7

Another ...

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