1. Home
  2. Computing & Technology
  3. JavaScript

Subroutine

By , About.com Guide

Definition: A subroutine 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 subroutine telling it what to process. A subroutine diifers from a function in that a function returns a value while a subroutine does not. While other programming languages may use different means of calling functions and subroutines - eg 'call subroutine();' and 'x = function();' - Javascript makes no distinction between subroutine and function calls.
Examples:
mySubroutine(x,y);
Explore JavaScript
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, 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
  4. Reference
  5. Javascript Glossary - Subroutine

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

All rights reserved.