Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

9. JavaScript: Functions

9. JavaScript: Functions

E pluribus unum. (One composed of many.)

—Virgil

Call me Ishmael.

—Herman Melville

When you call me that, smile.

—Owen Wister

O! call back yesterday, bid time return.

—William Shakespeare

Objectives

In this chapter you will:

• Construct programs modularly from small pieces called functions.

• Define new functions.

• Pass information between functions.

• Use simulation techniques based on random number generation.

• Use the new HTML5 audio and video elements

• Use additional global methods.

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

Outline

9.1 Introduction

9.2 Program Modules in JavaScript

9.3 Function Definitions

9.3.1 Programmer-Defined Function square

9.3.2 Programmer-Defined Function maximum

9.4 Notes on Programmer-Defined Functions


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint