1. Home
  2. Computing & Technology
  3. JavaScript

Var

By Stephen Chapman, About.com

Definition: The var statement is used to define a new variable that will be used in later processing. The scope of the variable will be the same as the scope of the block in which it is defined. Var is a reserved word and cannot be used for anything other than to define a new variable.
Examples:
var x = 5;
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

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

All rights reserved.