JavaScript/Reserved words/var

Previous: typeof Reserved words Next: void

The var keywordEdit

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

SyntaxEdit

  var variable[, variable2, ];

ExamplesEdit

  var number = 17;

  number += 2; // number is now 19

  var theArray = new Array();
Previous: typeof Reserved words Next: void