[Javascript] "var" keyword

Dan Costea costea.dan at ssi-schaefer.ro
Tue Apr 23 12:15:59 CDT 2002


    Hello all,

I can declare my variables with the "var" keyord, or not. I can delete a variable with "delete" keyword or not. But what is the real diference and how should I do?

Interesting (at least for me) example:

var x = 1;
y = 2;

alert (x);
alert (y);

delete x;
alert (x); 

delete y;
alert (y);


I am a little confused... I woul appreciate any clarification for you.
Thanks, Dan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20020423/b03feb2f/attachment.htm>


More information about the Javascript mailing list