<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Global Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/global/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/global/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Wed, 13 Apr 2022 16:30:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Global JavaScript Methods</title>
		<link>https://www.scmgalaxy.com/tutorials/global-javascript-methods/</link>
					<comments>https://www.scmgalaxy.com/tutorials/global-javascript-methods/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Thu, 05 Aug 2021 12:23:32 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Global]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[methods]]></category>
		<category><![CDATA[Number]]></category>
		<category><![CDATA[parseFloat ( )]]></category>
		<category><![CDATA[parseInt ( )]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7448</guid>

					<description><![CDATA[<p>Global JS Methods JavaScript global methods can be used on all JavaScript data types. Number ( ) parseFloat ( ) [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/global-javascript-methods/">Global JavaScript Methods</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Global JS Methods</h2>



<p class="wp-block-paragraph">JavaScript global methods can be used on all JavaScript data types.</p>



<ul class="wp-block-list"><li><strong>Number ( )</strong></li><li><strong>parseFloat ( )</strong></li><li><strong>parseInt ( )</strong></li></ul>



<h2 class="wp-block-heading">Number ( )</h2>



<p class="wp-block-paragraph">The Number() function converts the object argument to a number that<br>represents the object&#8217;s value.<br>If the value cannot be converted to a legal number, NaN is returned.<br>If the parameter is a Date object, the Number() function returns the number of<br>milliseconds since midnight January 1, 1970, UTC.</p>



<p class="wp-block-paragraph">Ex: &#8211;</p>



<p class="wp-block-paragraph">Number(true)<br>Number(“100”)<br>Number(100/“Hello”)</p>



<script src="https://gist.github.com/vijaypk376/e945e7ec936a53fcc02aaaa6289f93d9.js"></script>



<h2 class="wp-block-heading">parseInt ( )</h2>



<p class="wp-block-paragraph">The parseInt() function parses a string and returns an integer.</p>



<p class="wp-block-paragraph"><strong>Syntax:- parseInt(string, radix)</strong></p>



<p class="wp-block-paragraph">The radix parameter is used to specify which numeral system to be used, for example, a<br>the radix of 16 (hexadecimal) indicates that the number in the string should be parsed from<br>a hexadecimal number to a decimal number.</p>



<p class="wp-block-paragraph">If the radix parameter is omitted, JavaScript assumes the following:</p>



<ul class="wp-block-list"><li>If the string begins with &#8220;0x&#8221;, the radix is 16 (hexadecimal)</li><li>If the string begins with any other value, the radix is 10 (decimal)</li></ul>



<p class="wp-block-paragraph">Only the first number in the string is returned.<br>Leading and trailing spaces are allowed.<br>If the first character cannot be converted to a number, parseInt() returns NaN.</p>



<h2 class="wp-block-heading">parseInt ( )</h2>



<script src="https://gist.github.com/vijaypk376/3fc4fbd96cac35bf5164797e572bf462.js"></script>



<h2 class="wp-block-heading">parseFloat ( )</h2>



<p class="wp-block-paragraph">The parseFloat() function parses a string and returns a floating-point number. This function determines if the first character in the specified string is a number. If it is, it parses the string until it reaches the end of the number, and returns the number as a number, not as a string.</p>



<p class="wp-block-paragraph"><strong>Syntax: &#8211; parseFloat(string)</strong></p>



<ul class="wp-block-list"><li>Only the first number in the string is returned!</li><li>Leading and trailing spaces are allowed.</li><li>If the first character cannot be converted to a number, parseFloat() returns NaN.</li></ul>



<h2 class="wp-block-heading">parseFloat ( )</h2>



<script src="https://gist.github.com/vijaypk376/a6f6af2237a245e416cbf0e057c2d121.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/global-javascript-methods/">Global JavaScript Methods</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/global-javascript-methods/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How does JavaScript scope work?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-does-javascript-scope-work/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-does-javascript-scope-work/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Sat, 31 Jul 2021 12:13:29 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Global]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Variables]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7234</guid>

					<description><![CDATA[<p>Variable Scope JavaScript has two scopes: &#8211; Global Local Global Scope A variable that is declared outside a function definition [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-javascript-scope-work/">How does JavaScript scope work?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading"><strong>Variable Scope</strong></h2>



<p class="wp-block-paragraph">JavaScript has two scopes: &#8211;</p>



<ul class="wp-block-list"><li><strong>Global</strong></li><li><strong>Local</strong></li></ul>



<h2 class="wp-block-heading">Global Scope</h2>



<p class="wp-block-paragraph">A variable that is declared outside a function definition is a global variable, and its value is accessible and modifiable throughout your program. In a web browser, global variables are deleted when you close the browser window (or tab) but remain available to new pages loaded into the same window.</p>



<script src="https://gist.github.com/vijaypk376/c68b12b5f3a0b23aa8e7eca7249fae9b.js"></script>



<h2 class="wp-block-heading">Local Scope</h2>



<p class="wp-block-paragraph">A variable that is declared inside a function definition is local. It is created and destroyed every time the function is executed, and it cannot be accessed by any code outside the function. Inside a function, if a variable has not been declared with var it is created as a global variable.</p>



<script src="https://gist.github.com/vijaypk376/b5fc9aafd382023f3f8d73566a8cc803.js"></script>



<h2 class="wp-block-heading">Local Scope</h2>



<p class="wp-block-paragraph">If there is a function inside a function the inner function can access outer function‟s variables but the outer function can not access inner function‟s variables. Function arguments (parameters) work as local variables inside functions.</p>



<h2 class="wp-block-heading">Block Scope</h2>



<p class="wp-block-paragraph">Variables declared with var do not have block scope.</p>



<script src="https://gist.github.com/vijaypk376/bc60fd19190634293c62fa5b80a548f5.js"></script>



<h2 class="wp-block-heading">Block Scope</h2>



<p class="wp-block-paragraph">Identifiers declared with let and const do have block scope.</p>



<script src="https://gist.github.com/vijaypk376/dfd4e1170e7409581f15e693eb660e10.js"></script>



<h2 class="wp-block-heading">Variable Hoisting</h2>



<p class="wp-block-paragraph">Hoisting is JavaScript&#8217;s default behavior of moving declaration to the top of the function, if defined in a function, or the top of the global context, if outside a function.</p>



<script src="https://gist.github.com/vijaypk376/9ef97bc4c430b9dad808185ee64df7c8.js"></script>



<script src="https://gist.github.com/vijaypk376/16f6be6d8143fdaec7ff87839003fe21.js"></script>



<h2 class="wp-block-heading">Variable Hoisting</h2>



<p class="wp-block-paragraph">A variable can be used before it has been declared. Only variable declarations are hoisted to the top, not variable initialization.</p>



<script src="https://gist.github.com/vijaypk376/949b08c361c97ee4912fccdfe40ee3ff.js"></script>



<script src="https://gist.github.com/vijaypk376/d93670b96f5e555e58ddf9b75b3eda78.js"></script>



<h2 class="wp-block-heading">Closure</h2>



<p class="wp-block-paragraph">A closure is a function having access to the parent scope. It preserves the data from the outside.</p>



<p class="wp-block-paragraph">A closure is an inner function that has access to the outer (enclosing) function‟s variables.</p>



<p class="wp-block-paragraph">For every closure we have three scopes:-</p>



<ul class="wp-block-list"><li>Local Scope ( Own scope)</li><li>Outer Functions Scope</li><li>Global Scope</li></ul>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-javascript-scope-work/">How does JavaScript scope work?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-does-javascript-scope-work/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP Global and Local Variable</title>
		<link>https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/</link>
					<comments>https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Thu, 18 Mar 2021 06:13:54 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[Global]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Variables]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5611</guid>

					<description><![CDATA[<p>In this tutorial we will learn about declaring global and local variable in PHP. Initially we will see what is [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/">PHP Global and Local Variable</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this tutorial we will learn about declaring global and local variable in PHP.</p>



<p class="wp-block-paragraph">Initially we will see what is local variable and global variable with examples.</p>



<script src="https://gist.github.com/Joydeep-cotocus/93d822ce08097ab92e1f296f66bb6367.js"></script>



<p class="wp-block-paragraph">Here if we see the variable is declared inside the function &#8220;local&#8221; so it will work inside the local function only until we return the value inside the function.</p>



<script src="https://gist.github.com/Joydeep-cotocus/52b1f9707b6a87b5946b9a54501582ee.js"></script>



<p class="wp-block-paragraph">In this we can see that the variable &#8220;a&#8221; is declared outside the function local, so it won&#8217;t work inside the function until we call it.</p>



<script src="https://gist.github.com/Joydeep-cotocus/852dcd515b4fa7442a7426362f1a8aab.js"></script>



<p class="wp-block-paragraph">If we see the output for this we will see an error since &#8220;a&#8221; is a local variable and it will not work beyond the function &#8220;test&#8221;.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img fetchpriority="high" decoding="async" width="583" height="192" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-4.jpg" alt="" class="wp-image-5612" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-4.jpg 583w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-4-300x99.jpg 300w" sizes="(max-width: 583px) 100vw, 583px" /></figure></div>



<script src="https://gist.github.com/Joydeep-cotocus/a8bb1d2e2d31211d5b38d87bbda6e0fe.js"></script>



<p class="wp-block-paragraph">Now in this code if we see, variable &#8220;a&#8221; is declared globally and we will get an error if we call it inside any function.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="538" height="182" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-5.jpg" alt="" class="wp-image-5613" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-5.jpg 538w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-5-300x101.jpg 300w" sizes="(max-width: 538px) 100vw, 538px" /></figure></div>



<p class="wp-block-paragraph">To execute the global variable in the function we need to use predefined variable &#8220;global&#8221; inside the function.</p>



<script src="https://gist.github.com/Joydeep-cotocus/fde15810d9ffabdd4b27ca2363090cea.js"></script>



<p class="wp-block-paragraph">We will see now that it will return value inside the function as well as outside the function.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="446" height="176" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-6.jpg" alt="" class="wp-image-5614" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-6.jpg 446w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-6-300x118.jpg 300w" sizes="(max-width: 446px) 100vw, 446px" /></figure></div>



<p class="wp-block-paragraph">References:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy"  id="_ytid_66794"  width="640" height="360"  data-origwidth="640" data-origheight="360" src="https://www.youtube.com/embed/EUqK-1Xdb38?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/">PHP Global and Local Variable</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
