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

Chapter 4. Working with Functions > What Is a Function?

What Is a Function?

As you'll see throughout this book, JavaScript comes with a large number of built-in features that perform specific tasks. For example, something called the Math object has a built-in method for calculating the square root of a number. Similarly, a feature called the String object has a ready-made method for converting a string value to all lowercase letters.

There are, in fact, hundreds of these ready-to-roll features that perform tasks that range from the indispensable to the obscure. But JavaScript can't possibly do everything that you'd like it to do. If your script requires a particular task or calculation that isn't part of the JavaScript language, the solution is to create your own function to handle it. This chapter shows you how to do just that.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint