<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_Tutorial%2FLanguage_Basics%2FVariable_Scope</id>
		<title>JavaScript Tutorial/Language Basics/Variable Scope - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_Tutorial%2FLanguage_Basics%2FVariable_Scope"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_Tutorial/Language_Basics/Variable_Scope&amp;action=history"/>
		<updated>2026-04-04T21:14:15Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_Tutorial/Language_Basics/Variable_Scope&amp;diff=9309&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_Tutorial/Language_Basics/Variable_Scope&amp;diff=9309&amp;oldid=prev"/>
				<updated>2010-05-26T08:24:57Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 08:24, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_Tutorial/Language_Basics/Variable_Scope&amp;diff=9308&amp;oldid=prev</id>
		<title> в 18:52, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_Tutorial/Language_Basics/Variable_Scope&amp;diff=9308&amp;oldid=prev"/>
				<updated>2010-05-25T18:52:56Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Variable Scope==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A variable can be either global or local in JavaScript.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;All variables are global unless they are declared in a function.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Variables declared in a function is local to that function.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;It is possible for two variables with the same name to exist if one is global and the other is local.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;When accessing the variable within the function, you are accessing the local variable.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the variable is accessed outside the function, the global variable is used.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Always use the var keyword to declare local variables in functions.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Without var, JavaScript will create a global variable.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;HTML&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT LANGUAGE=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
    //Initialize global variables&lt;br /&gt;
    color = &amp;quot;global&amp;quot;;&lt;br /&gt;
    var size = 15;&lt;br /&gt;
    function myFunction() {&lt;br /&gt;
      //Declare and set variables inside function&lt;br /&gt;
      color = &amp;quot;set in a function&amp;quot;;&lt;br /&gt;
      price = &amp;quot;1111&amp;quot;;&lt;br /&gt;
      var size = 17;&lt;br /&gt;
      document.write(&amp;quot;The &amp;quot;,size,&amp;quot; inch &amp;quot;,color);&lt;br /&gt;
      document.write(&amp;quot; price is &amp;quot;,price);&lt;br /&gt;
    }&lt;br /&gt;
    myFunction();&lt;br /&gt;
    document.write(&amp;quot;&amp;lt;BR&amp;gt;The &amp;quot;,size,&amp;quot; inch &amp;quot;,color);&lt;br /&gt;
    document.write(&amp;quot; price is &amp;quot;,price);&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
&amp;lt;/HTML&amp;gt;&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>