1. Home
  2. Computing & Technology
  3. JavaScript
An introduction to using functions with JavaScript.
Modular Code Using JavaScript Functions
Reuse your existing JavaScript code in multiple places by converting it into functions.
Introduction to Functions
The simplest way to set up reusable code in JavaScript is using Functions.
How to Call a Function
The way you call a function is slightly different from the way you reference variables.
Same Function Different Variables
If you define arguments for your function then you cal pass different variables as parameters for each call.
Optional Parameters
JavaScript allows you to pass different numbers of parameters to your function at different times.
The Scope of Variables
Variables inside a function may not exist outside of it.
Returning a Value
Functions can have a value that they return back into the code they were called from.
Function Libraries
Writing your own library of functions or using such a library written by others will make writing JavaScripts faster.
Explore JavaScript
About.com Special Features

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

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript
  4. Javascript Tutorials
  5. Learn Modern JavaScript
  6. 3. Functions

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

All rights reserved.