1. Home
  2. Computing & Technology
  3. JavaScript

Function

By , About.com Guide

Definition: A function is a group of statements that have been collected together and given a name. This group of statements can then be run from several different places within the program by calling it by name. You can pass parameters to a function telling it what to process and the function can return a value. When a function does not return a value it is often referred to as a sub-routine.
Examples:
x = myFunction(y);
Explore JavaScript
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.