< JavaScript < Reserved words

The var keyword

The var keyword is optional and used to declare a variable. This operator is necessary if the code includes the line "use strict;".

Syntax

  var variable[, variable2, ];

Examples

  var number = 17;

  number += 2; // number is now 19

  var theArray = new Array();
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.