faqts : Computers : Programming : Languages : JavaScript : Language Core : Variables

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 9 people (56%) answered Yes
Recently 5 of 9 people (56%) answered Yes

Entry

can I assign a value to a global variable inside a function and access the global variable outside

Jan 16th, 2004 09:14
Jean-Bernard Valentaten, Good Luck,


Well, that's the purpose of a global variable, isn't it?! ;)
As long as you do not declare a local var inseide the function, that 
has the same name as the gloval one (scoping), you'll be able to both 
read & write the global var whenever you like :)
HTH,
Jean