[thelist] Java Script and variables

.jeff jeff at members.evolt.org
Wed Jun 13 12:19:19 CDT 2001


ryan,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Ryan Romanelli
:
: before writing the function declare num1
: as a variable.
:
: var num1 = "";
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

fwiw, i'd like to correct your usage of the term "declare".

declaring a variable is done by using the "var" keyword and the name of the
variable.

var foo;

your example is declaring and initializing the variable.  if you simply
declare a variable without initializing it with a value, it's value is
"undefined".

var foo = 1;

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list