<?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>functions Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/functions/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/functions/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 21 Feb 2026 07:13:46 +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>Understanding Parameters: Use Cases, Architecture, Workflow, and Getting Started Guide</title>
		<link>https://www.scmgalaxy.com/tutorials/understanding-parameters-use-cases-architecture-workflow-and-getting-started-guide/</link>
					<comments>https://www.scmgalaxy.com/tutorials/understanding-parameters-use-cases-architecture-workflow-and-getting-started-guide/#respond</comments>
		
		<dc:creator><![CDATA[Vijay K]]></dc:creator>
		<pubDate>Mon, 16 Jun 2025 12:37:00 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CodingConcepts]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Parameters]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ProgrammingBestPractices]]></category>
		<category><![CDATA[SoftwareArchitecture]]></category>
		<category><![CDATA[SoftwareDevelopment]]></category>
		<category><![CDATA[TechTutorial]]></category>
		<category><![CDATA[Variables]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=12793</guid>

					<description><![CDATA[<p>What are Parameters? Parameters are variables used in programming that allow you to pass data or values into functions, methods, [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/understanding-parameters-use-cases-architecture-workflow-and-getting-started-guide/">Understanding Parameters: Use Cases, Architecture, Workflow, and Getting Started Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="683" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-114-1024x683.png" alt="" class="wp-image-12804" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-114-1024x683.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-114-300x200.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-114-768x512.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-114.png 1536w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">What are Parameters?</h3>



<p class="wp-block-paragraph"><strong>Parameters</strong> are variables used in programming that allow you to pass <strong>data</strong> or <strong>values</strong> into functions, methods, or procedures to enable them to perform tasks with varying inputs. When you define a function or method, you can specify parameters in its declaration, which are placeholders for the values that will be passed when the function is called. Parameters act as input data for the function and allow it to process different values each time it is executed.</p>



<p class="wp-block-paragraph">Parameters are essential in making <strong>functions</strong> reusable and dynamic. By defining parameters, functions can perform tasks based on the values passed to them, without having to hard-code specific data. They serve as a critical component of function-based programming and are used in many programming languages such as <strong>Python</strong>, <strong>Java</strong>, <strong>JavaScript</strong>, <strong>C</strong>, <strong>C++</strong>, and more.</p>



<p class="wp-block-paragraph">In many cases, <strong>parameters</strong> are also referred to as <strong>arguments</strong>, though there is a subtle distinction between the two:</p>



<ul class="wp-block-list">
<li><strong>Parameter</strong>: The variable in the function definition.</li>



<li><strong>Argument</strong>: The actual value passed to the parameter when the function is called.</li>
</ul>



<p class="wp-block-paragraph">For example, consider a simple function that adds two numbers:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
def add_numbers(a, b):
    return a + b

</pre></div>


<p class="wp-block-paragraph">Here, <code>a</code> and <code>b</code> are parameters. When you call the function with actual values, those values are arguments:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
add_numbers(3, 5)

</pre></div>


<p class="wp-block-paragraph">In this case, <code>3</code> and <code>5</code> are arguments passed to the <code>a</code> and <code>b</code> parameters of the <code>add_numbers</code> function.</p>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">What are the Major Use Cases of Parameters?</h3>



<p class="wp-block-paragraph">Parameters are used in a wide range of programming scenarios. Below are the major use cases:</p>



<h4 class="wp-block-heading">1. <strong>Dynamic Function Behavior</strong></h4>



<p class="wp-block-paragraph">Parameters allow functions to behave dynamically by taking input values that determine the function&#8217;s behavior. Instead of hardcoding values, parameters allow the same function to be executed with different inputs, making the function reusable for different scenarios.</p>



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



<ul class="wp-block-list">
<li>A <strong>sum function</strong> can be reused for adding any two numbers, and the numbers are passed as parameters to define the function&#8217;s behavior.</li>
</ul>



<h4 class="wp-block-heading">2. <strong>Encapsulation of Complex Operations</strong></h4>



<p class="wp-block-paragraph">Functions that perform <strong>complex operations</strong> (e.g., calculations, data processing) often require different values for each operation. Parameters encapsulate the input data, allowing the function to work on a variety of inputs without modifying the core logic.</p>



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



<ul class="wp-block-list">
<li>A <strong>file processing function</strong> can take parameters for the file path, encoding, and output format, enabling the same function to process different files.</li>
</ul>



<h4 class="wp-block-heading">3. <strong>Code Reusability</strong></h4>



<p class="wp-block-paragraph">Parameters increase <strong>code reusability</strong> by allowing functions to work with different inputs and perform similar operations without writing multiple versions of the same function.</p>



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



<ul class="wp-block-list">
<li>A <strong>data sorting function</strong> can be reused with different datasets and sort orders by passing the dataset and order type as parameters.</li>
</ul>



<h4 class="wp-block-heading">4. <strong>Configuration of Functions</strong></h4>



<p class="wp-block-paragraph">Parameters allow functions to be configured and customized without changing their internal logic. This allows greater flexibility, as parameters control aspects of the function&#8217;s execution, like <strong>timeouts</strong>, <strong>limits</strong>, and <strong>environment settings</strong>.</p>



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



<ul class="wp-block-list">
<li>A <strong>server connection function</strong> might take parameters for the server address, port, and authentication details, allowing the function to connect to various servers with different configurations.</li>
</ul>



<h4 class="wp-block-heading">5. <strong>Control Flow and Decision Making</strong></h4>



<p class="wp-block-paragraph">Parameters can control the <strong>flow of a program</strong>, allowing developers to implement decision-making logic within functions based on the input values. This can help in implementing <strong>conditional operations</strong> and <strong>branching logic</strong>.</p>



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



<ul class="wp-block-list">
<li>A <strong>payment processing function</strong> could take a <code>payment_method</code> parameter to determine whether the payment is processed via credit card, PayPal, or another method.</li>
</ul>



<h4 class="wp-block-heading">6. <strong>Interfacing with External Systems</strong></h4>



<p class="wp-block-paragraph">In distributed systems or when working with external APIs, parameters serve as the mechanism to pass data between different services, applications, or system layers. They act as <strong>data carriers</strong> that transport necessary information across systems.</p>



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



<ul class="wp-block-list">
<li>An <strong>API request</strong> might take parameters like <code>user_id</code>, <code>action_type</code>, and <code>time_range</code> to request specific data from a server.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">How Parameters Work Along with Architecture?</h3>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="683" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-115-1024x683.png" alt="" class="wp-image-12805" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-115-1024x683.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-115-300x200.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-115-768x512.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-115.png 1536w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">In programming, parameters fit into the overall architecture of functions, methods, and procedures. Below is an explanation of how parameters are used within the architecture of a function and the general software architecture.</p>



<h4 class="wp-block-heading">1. <strong>Function Declaration</strong></h4>



<p class="wp-block-paragraph">When you define a function or method, you specify the parameters within the function’s <strong>declaration</strong>. These parameters act as placeholders for the values that will be passed when the function is invoked.</p>



<p class="wp-block-paragraph">Example in Python:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
def greet_user(username):
    print(f&quot;Hello, {username}!&quot;)

</pre></div>


<p class="wp-block-paragraph">Here, <code>username</code> is a parameter that is used in the function <code>greet_user</code>. When you call the function, you pass an <strong>argument</strong> to this parameter:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
greet_user(&quot;Alice&quot;)

</pre></div>


<h4 class="wp-block-heading">2. <strong>Function Call</strong></h4>



<p class="wp-block-paragraph">When a function is invoked, you pass values, known as <strong>arguments</strong>, to the parameters in the function definition. These arguments replace the parameters with specific data when the function executes. The argument values are assigned to the corresponding parameters, and the function uses them to perform its operations.</p>



<h4 class="wp-block-heading">3. <strong>Parameter Scope</strong></h4>



<p class="wp-block-paragraph">The scope of a parameter is <strong>local</strong> to the function or method in which it is defined. This means the parameter can only be used inside the function or method where it is declared. Once the function execution is complete, the parameter value is discarded.</p>



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


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
def calculate_area(radius):
    area = 3.14 * radius * radius  # radius is a parameter
    return area

# radius is not accessible outside the function

</pre></div>


<h4 class="wp-block-heading">4. <strong>Default Parameters</strong></h4>



<p class="wp-block-paragraph">Some programming languages allow <strong>default parameter values</strong>, which are used when no argument is passed to the function. This makes parameters optional.</p>



<p class="wp-block-paragraph">Example in Python:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
def greet_user(username=&quot;Guest&quot;):
    print(f&quot;Hello, {username}!&quot;)

greet_user()  # Uses the default value &quot;Guest&quot;
greet_user(&quot;Alice&quot;)  # Uses the provided argument &quot;Alice&quot;

</pre></div>


<h4 class="wp-block-heading">5. <strong>Varied Number of Parameters (Arbitrary Arguments)</strong></h4>



<p class="wp-block-paragraph">Some languages support functions that accept a <strong>variable number of parameters</strong>, often using a special syntax. In Python, this is achieved using <code>*args</code> for non-keyword arguments or <code>**kwargs</code> for keyword arguments.</p>



<p class="wp-block-paragraph">Example in Python:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
def sum_numbers(*args):
    return sum(args)

print(sum_numbers(1, 2, 3))  # Output: 6

</pre></div>


<p class="wp-block-paragraph">Here, <code>*args</code> allows the function to accept an arbitrary number of arguments.</p>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">Basic Workflow of Parameters</h3>



<p class="wp-block-paragraph">The basic workflow for using parameters in functions follows a few simple steps:</p>



<ol class="wp-block-list">
<li><strong>Define Parameters in Function Declaration</strong>
<ul class="wp-block-list">
<li>Define the function and specify the parameters inside the parentheses.</li>
</ul>
</li>



<li><strong>Call the Function and Pass Arguments</strong>
<ul class="wp-block-list">
<li>When calling the function, pass values (arguments) that correspond to the parameters defined in the function.</li>
</ul>
</li>



<li><strong>Use Parameters Inside the Function</strong>
<ul class="wp-block-list">
<li>Inside the function, use the parameter values to perform computations or execute specific tasks based on the input.</li>
</ul>
</li>



<li><strong>Return Results (If Applicable)</strong>
<ul class="wp-block-list">
<li>The function can return a value based on the parameters, which can be used elsewhere in the program.</li>
</ul>
</li>



<li><strong>Handle Optional or Variable Parameters</strong>
<ul class="wp-block-list">
<li>Define default values for parameters or use variable argument techniques (like <code>*args</code> or <code>**kwargs</code>) to make the function more flexible.</li>
</ul>
</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">Step-by-Step Getting Started Guide for Parameters</h3>



<p class="wp-block-paragraph">Here’s a step-by-step guide to help you understand and implement parameters in your programs:</p>



<h4 class="wp-block-heading">Step 1: <strong>Define a Simple Function</strong></h4>



<p class="wp-block-paragraph">Start by creating a simple function that accepts a single parameter:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
def say_hello(name):
    print(f&quot;Hello, {name}!&quot;)

</pre></div>


<p class="wp-block-paragraph">This function takes <code>name</code> as a parameter and prints a greeting.</p>



<h4 class="wp-block-heading">Step 2: <strong>Call the Function with an Argument</strong></h4>



<p class="wp-block-paragraph">Now, call the function and pass an argument to the parameter:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
say_hello(&quot;Alice&quot;)

</pre></div>


<p class="wp-block-paragraph">This will output:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Hello, Alice!

</pre></div>


<h4 class="wp-block-heading">Step 3: <strong>Add More Parameters</strong></h4>



<p class="wp-block-paragraph">You can add more parameters to the function to make it more versatile. For example, let’s define a function to calculate the area of a rectangle:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
def calculate_area(length, width):
    area = length * width
    return area

</pre></div>


<h4 class="wp-block-heading">Step 4: <strong>Call the Function with Multiple Arguments</strong></h4>



<p class="wp-block-paragraph">Pass multiple arguments to the function:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
result = calculate_area(5, 3)
print(result)  # Output: 15

</pre></div>


<h4 class="wp-block-heading">Step 5: <strong>Use Default Parameters</strong></h4>



<p class="wp-block-paragraph">Let’s add a default value to a parameter. This makes it optional:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
def greet_user(username=&quot;Guest&quot;):
    print(f&quot;Hello, {username}!&quot;)

</pre></div>


<p class="wp-block-paragraph">You can call it with or without an argument:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
greet_user()  # Output: Hello, Guest!
greet_user(&quot;Bob&quot;)  # Output: Hello, Bob!

</pre></div>


<h4 class="wp-block-heading">Step 6: <strong>Use Variable-Length Arguments</strong></h4>



<p class="wp-block-paragraph">If you want to accept an arbitrary number of arguments, use <code>*args</code> or <code>**kwargs</code>:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
def add_numbers(*args):
    return sum(args)

print(add_numbers(1, 2, 3, 4))  # Output: 10

</pre></div>


<p class="wp-block-paragraph">This allows you to pass any number of arguments to the function.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/understanding-parameters-use-cases-architecture-workflow-and-getting-started-guide/">Understanding Parameters: Use Cases, Architecture, Workflow, and Getting Started Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/understanding-parameters-use-cases-architecture-workflow-and-getting-started-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to use Timing Animations Using Callback Functions in jQuery?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-use-timing-animations-using-callback-functions-in-jquery/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-use-timing-animations-using-callback-functions-in-jquery/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Fri, 24 Sep 2021 12:55:18 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[animations]]></category>
		<category><![CDATA[callback]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[timing]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=9202</guid>

					<description><![CDATA[<p>So in this blog, we’re going to create a little bit more at Timing Animations Using Callback Functions in jQuery. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-timing-animations-using-callback-functions-in-jquery/">How to use Timing Animations Using Callback Functions in jQuery?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">So in this blog, we’re going to create a little bit more at <strong>Timing Animations </strong>Using Callback Functions in <strong>jQuery</strong>.</p>



<p class="wp-block-paragraph">In the previous blog, we also learn how can animate multiple C S S properties at once. So let’s go ahead and do that for the blue box first in <strong>index.html</strong>, with help of <strong>style.css</strong> &amp; <strong>main.js</strong>.</p>



<script src="https://gist.github.com/ajcotocus/d872107df5e69f2f4d27c79765503d14.js"></script>



<script src="https://gist.github.com/ajcotocus/9b772b2a8f879758df2795c3d3d7ba6a.js"></script>



<script src="https://gist.github.com/ajcotocus/06f01d1b6a3a2abbf44b8f6ad35e6693.js"></script>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="288" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-103-1024x288.png" alt="" class="wp-image-9203" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-103-1024x288.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-103-300x84.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-103-768x216.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-103-1536x433.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-103.png 1658w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Timing Animations Using Callback Functions in jQuery</figcaption></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="305" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-104-1024x305.png" alt="" class="wp-image-9204" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-104-1024x305.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-104-300x89.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-104-768x229.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-104-1536x457.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-104.png 1650w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>Timing Animations Using Callback Functions in jQuery after animations effects</figcaption></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-timing-animations-using-callback-functions-in-jquery/">How to use Timing Animations Using Callback Functions in jQuery?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-use-timing-animations-using-callback-functions-in-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How does the JavaScript Promise work?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-does-the-javascript-promise-work/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-does-the-javascript-promise-work/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 17 Aug 2021 12:45:21 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Method]]></category>
		<category><![CDATA[Operation]]></category>
		<category><![CDATA[Promises]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8048</guid>

					<description><![CDATA[<p>Promise A Promise is an object representing the eventual completion or failure of an asynchronous operation. A JavaScript Promise object [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-the-javascript-promise-work/">How does the JavaScript Promise 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>Promise</strong></h2>



<p class="wp-block-paragraph">A Promise is an object representing the eventual completion or failure of an asynchronous operation. A JavaScript Promise object contains both the producing code and calls to the consuming code. It can be used to deal with Asynchronous operations in JavaScript.</p>



<p class="wp-block-paragraph"><strong>Promise State:-</strong></p>



<p class="wp-block-paragraph">Pending &#8211; Initial State, Not yet Fulfilled or Rejected<br>Fulfilled/Resolved – Promise Completed<br>Rejected – Promise Failed</p>



<h2 class="wp-block-heading"><strong>How Promise works</strong></h2>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/how-promise-works.png" alt="" class="wp-image-8050" width="827" height="402" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/how-promise-works.png 553w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/how-promise-works-300x146.png 300w" sizes="auto, (max-width: 827px) 100vw, 827px" /></figure>



<ul class="wp-block-list"><li>A pending promise can either be Resolved with a value or Rejected with a reason (error).</li><li>When either of these options happens, the associated handlers queued up by a promise&#8217;s then method are called.</li><li>A promise is said to be settled if it is either Resolved or Rejected, but not Pending.</li></ul>



<h2 class="wp-block-heading"><strong>Creating Promise</strong></h2>



<p class="wp-block-paragraph">Promise () – A Promise object is created using the new keyword and its constructor. This constructor takes a function, called the &#8220;executor function&#8221;, as its parameter. This function should take two functions as parameters. The first of these functions (resolve) is called when the asynchronous task completes successfully and returns the results of the task as a value. The second (reject) is called when the task fails and returns the reason for failure, which is typically an error object.</p>



<p class="wp-block-paragraph">Syntax:- Promise (executor)</p>



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



<p class="wp-block-paragraph">A JavaScript Promise object contains both the producing code and calls to the consuming code.</p>



<h2 class="wp-block-heading"><strong>Function Returning a Promise</strong></h2>



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



<h2 class="wp-block-heading"><strong>then( ) Method</strong></h2>



<p class="wp-block-paragraph">The then() method returns a Promise. It takes up to two arguments: callback functions for the success and failure cases of the Promise. As then the method returns a Promise so we can do method chaining.</p>



<p class="wp-block-paragraph">Syntax:- then(onResolved, onRejected)</p>



<p class="wp-block-paragraph">onResolved &#8211; A Function called if the Promise is fulfilled. This function has one argument, the fulfillment value.</p>



<p class="wp-block-paragraph">onRejected &#8211; A Function called if the Promise is rejected. This function has one argument, the rejection reason.</p>



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



<h2 class="wp-block-heading"><strong>Promise</strong></h2>



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



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



<h2 class="wp-block-heading"><strong>Chaining</strong></h2>



<p class="wp-block-paragraph">The then method returns a Promise which allows for method chaining. If the function passed as a handler to then returns a Promise, an equivalent Promise will be exposed to the subsequent then in the method chain.</p>



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



<h2 class="wp-block-heading"><strong>catch () Method</strong></h2>



<p class="wp-block-paragraph">The <em>catch()</em> method returns a Promise and deals with rejected cases only. It behaves the same as calling <em>then(undefined, onRejected)</em>. In fact, calling <em>catch(onRejected)</em> internally calls <em>then(undefined, onRejected)</em>.</p>



<p class="wp-block-paragraph">The catch method is used for error handling in promise composition. Since it returns a Promise, it can be chained in the same way as its sister method, then()</p>



<p class="wp-block-paragraph">Syntax:- catch(callback)</p>



<p class="wp-block-paragraph">Where the callback is a function called when the Promise is rejected. This function has one argument <em>error</em> – The rejection error.</p>



<h2 class="wp-block-heading"><strong>catch () Method</strong></h2>



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



<h2 class="wp-block-heading"><strong>finally () Method</strong></h2>



<p class="wp-block-paragraph">The finally() method returns a Promise. When the promise is settled, i.e either fulfilled or rejected, the specified callback function is executed. This provides a way for code to be run whether the promise was fulfilled successfully or rejected once the Promise has been dealt with.</p>



<p class="wp-block-paragraph">This helps to avoid duplicating code in both the promise&#8217;s then() and catch() handlers.</p>



<p class="wp-block-paragraph">Syntax:- finally(callback)</p>



<h2 class="wp-block-heading"><strong>finally () Method</strong></h2>



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



<h2 class="wp-block-heading"><strong>Chaining</strong></h2>



<script src="https://gist.github.com/vijaypk376/37d902b6b443559b020399056cb5d998.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-the-javascript-promise-work/">How does the JavaScript Promise 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-the-javascript-promise-work/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How does the Import and Export module work in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-does-the-import-and-export-module-work-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-does-the-import-and-export-module-work-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 17 Aug 2021 12:05:42 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Import]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Module]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8035</guid>

					<description><![CDATA[<p>What is Module In JavaScript, a Module is a JavaScript file where we write codes. The object is a module [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-the-import-and-export-module-work-in-javascript/">How does the Import and Export module work in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading"><strong>What is Module</strong></h2>



<p class="wp-block-paragraph">In JavaScript, a Module is a JavaScript file where we write codes. The object is a module that is not available for use unless the module file exports them.</p>



<h2 class="wp-block-heading"><strong>Exporting Module</strong></h2>



<p class="wp-block-paragraph">export &#8211; The export statement is used when creating JavaScript modules to export functions, objects, or primitive values from the module so they can be used by other programs with the import statement.</p>



<p class="wp-block-paragraph">There are two different types of export &#8211; named and default. You can have multiple named exports per module but only one default export.</p>



<h2 class="wp-block-heading"><strong>Default Export</strong></h2>



<p class="wp-block-paragraph">You can have only one default export per module. A default export can be imported with any name.</p>



<p class="wp-block-paragraph"><strong>mobile.js</strong></p>



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



<h2 class="wp-block-heading"><strong>Named Export</strong></h2>



<p class="wp-block-paragraph">You can have multiple named exports per module. Named exports are useful to export several values. During the import, it is mandatory to use the same name of the corresponding object.</p>



<p class="wp-block-paragraph"><strong>mobile.js</strong></p>



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



<h2 class="wp-block-heading"><strong>Named Export</strong></h2>



<p class="wp-block-paragraph">You can have multiple named exports per module. Named exports are useful to export several values. During the import, it is mandatory to use the same name of the corresponding object.</p>



<p class="wp-block-paragraph"><strong>mobile.js</strong></p>



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



<h2 class="wp-block-heading"><strong>Importing Module</strong></h2>



<p class="wp-block-paragraph">import &#8211;  The static import statement is used to import bindings that are exported by another module. Imported modules are in strict mode whether you declare them as such or not.</p>



<h2 class="wp-block-heading"><strong>Importing Defaults</strong></h2>



<p class="wp-block-paragraph">You can have only one default export per module. A default export can be imported with any name.</p>



<p class="wp-block-paragraph"><strong>mobile.js</strong></p>



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



<p class="wp-block-paragraph"><strong>app.js</strong></p>



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



<h2 class="wp-block-heading"><strong>Importing Named</strong></h2>



<p class="wp-block-paragraph">You can have multiple named exports per module. Named exports are useful to export several values. During the import, it is mandatory to use the same name of the corresponding object.</p>



<p class="wp-block-paragraph"><strong>mobile.js</strong></p>



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



<p class="wp-block-paragraph"><strong>app.js</strong></p>



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



<h2 class="wp-block-heading"><strong>Importing All</strong></h2>



<p class="wp-block-paragraph"><strong>mobile.js</strong></p>



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



<p class="wp-block-paragraph"><strong>app.js</strong></p>



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



<h2 class="wp-block-heading"><strong>Importing Default and Named</strong></h2>



<p class="wp-block-paragraph"><strong>mobile.js</strong></p>



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



<p class="wp-block-paragraph"><strong>app.js</strong></p>



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



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-the-import-and-export-module-work-in-javascript/">How does the Import and Export module work in JavaScript?</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-the-import-and-export-module-work-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the difference between a timeout and an interval in Javascript?</title>
		<link>https://www.scmgalaxy.com/tutorials/what-is-the-difference-between-a-timeout-and-an-interval-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/what-is-the-difference-between-a-timeout-and-an-interval-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Fri, 13 Aug 2021 11:45:42 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[interval ID]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Method]]></category>
		<category><![CDATA[Parameters]]></category>
		<category><![CDATA[setInterval( )]]></category>
		<category><![CDATA[setTimeout()]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7919</guid>

					<description><![CDATA[<p>setTimeout( ) Method The setTimeout() method sets a timer which executes a function or specified piece of code once after [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-the-difference-between-a-timeout-and-an-interval-in-javascript/">What is the difference between a timeout and an interval in Javascript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading"><strong>setTimeout( ) Method</strong></h2>



<p class="wp-block-paragraph">The setTimeout() method sets a timer which executes a function or specified piece of code once after the timer expires. The function is only executed once. It returns a positive integer value which identifies the timer created by the call to setTimeout(); this value can be passed to clearTimeout() to cancel the timeout.</p>



<p class="wp-block-paragraph">S<strong>yntax: &#8211;<br>setTimeout (function, milliseconds, para1, para2);<br>Ex: &#8211; var timeoutID = setTimeout(show, 2000);</strong></p>



<h2 class="wp-block-heading"><strong>clearTimeout( ) Method</strong></h2>



<p class="wp-block-paragraph">The clearTimeout() method cancels a timeout previously established by calling setTimeout(). The ID value returned by setTimeout() is used as the parameter for the clearTimeout() method.</p>



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



<p class="wp-block-paragraph"><strong>Ex: &#8211; clearTimeout(timeoutID);</strong></p>



<h2 class="wp-block-heading"><strong>setInterval( ) Method</strong></h2>



<p class="wp-block-paragraph">The setInterval() method repeatedly calls a function or executes a code snippet, with a fixed time delay between each call. It returns an interval ID that uniquely identifies the interval, so you can remove it later by calling clearInterval().</p>



<p class="wp-block-paragraph"><strong>Syntax: &#8211; setInterval (function, milliseconds, para1, para2);</strong></p>



<p class="wp-block-paragraph"><strong>Ex: &#8211; var intervalID = setInterval(show, 2000);</strong></p>



<h2 class="wp-block-heading"><strong>clearInterval( ) Method</strong></h2>



<p class="wp-block-paragraph">The clearInterval() method cancels a timed, repeating action that was previously established by a call to setInterval().</p>



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



<p class="wp-block-paragraph"><strong>Ex: &#8211; clearInterval(intervalID);</strong></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-the-difference-between-a-timeout-and-an-interval-in-javascript/">What is the difference between a timeout and an interval in Javascript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/what-is-the-difference-between-a-timeout-and-an-interval-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Which Array Functions are present in Array</title>
		<link>https://www.scmgalaxy.com/tutorials/which-array-functions-are-present-in-array/</link>
					<comments>https://www.scmgalaxy.com/tutorials/which-array-functions-are-present-in-array/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 12:02:15 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[Array functions]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[What are the Array Functions]]></category>
		<category><![CDATA[Which Array Functions are present in Array]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7484</guid>

					<description><![CDATA[<p>array_change_key_case — Changes the case of all keys in an array array_chunk — Split an array into chunks array_column — [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/which-array-functions-are-present-in-array/">Which Array Functions are present in Array</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<ul class="wp-block-list"><li>array_change_key_case — Changes the case of all keys in an array </li><li>array_chunk — Split an array into chunks </li><li>array_column — Return the values from a single column in the input array </li><li>array_combine — Creates an array by using one array for keys and another for its values </li><li>array_count_values — Counts all the values of an array</li><li>array_diff_assoc — Computes the difference of arrays with additional index check </li><li>array_diff_key — Computes the difference of arrays using keys for comparison</li><li>array_diff_uassoc — Computes the difference of arrays with additional index check which is performed by a user supplied callback function</li><li>array_diff_ukey — Computes the difference of arrays using a callback function on the keys for comparison</li><li>array_diff — Computes the difference of arrays </li><li>array_fill_keys — Fill an array with values, specifying keys </li><li>array_fill — Fill an array with values</li><li>array_filter — Filters elements of an array using a callback function</li><li>array_flip — Exchanges all keys with their associated values in an array </li><li>array_intersect_assoc — Computes the intersection of arrays with additional index check </li><li>array_intersect_key — Computes the intersection of arrays using keys for comparison</li><li>array_intersect_uassoc — Computes the intersection of arrays with additional index check, compares indexes by a callback function</li><li>array_intersect_ukey — Computes the intersection of arrays using a callback function on the keys for comparison </li><li>array_intersect — Computes the intersection of arrays</li><li>array_key_exists — Checks if the given key or index exists in the array</li><li>array_keys — Return all the keys or a subset of the keys of an array </li><li>array_map — Applies the callback to the elements of the given arrays </li><li>array_merge_recursive — Merge two or more arrays recursively </li><li>array_merge — Merge one or more arrays </li><li>array_multisort — Sort multiple or multi-dimensional arrays </li><li>array_pad — Pad array to the specified length with a value </li><li>array_pop — Pop the element off the end of array </li><li>array_product — Calculate the product of values in an array </li><li>array_push — Push one or more elements onto the end of array </li><li>array_rand — Pick one or more random entries out of an array </li><li>array_reduce — Iteratively reduce the array to a single value using a callback function </li><li>array_replace_recursive — Replaces elements from passed arrays into the first array recursively </li><li>array_replace — Replaces elements from passed arrays into the first array </li><li>array_reverse — Return an array with elements in reverse order </li><li>array_search — Searches the array for a given value and returns the first corresponding key if successful</li><li>array_shift — Shift an element off the beginning of array </li><li>array_slice — Extract a slice of the array </li><li>array_splice — Remove a portion of the array and replace it with something else </li><li>array_sum — Calculate the sum of values in an array </li><li>array_udiff_assoc — Computes the difference of arrays with additional index check, compares data by a callback function </li><li>array_udiff_uassoc — Computes the difference of arrays with additional index check, compares data and indexes by a callback function </li><li>array_udiff — Computes the difference of arrays by using a callback function for data comparison </li><li>array_uintersect_assoc — Computes the intersection of arrays with additional index check, compares data by a callback function </li><li>array_uintersect_uassoc — Computes the intersection of arrays with additional index check, compares data and indexes by separate callback functions</li><li>array_uintersect — Computes the intersection of arrays, compares data by a callback function </li><li>array_unique — Removes duplicate values from an array </li><li>array_unshift — Prepend one or more elements to the beginning of an array </li><li>array_values — Return all the values of an array</li><li>array_walk_recursive — Apply a user function recursively to every member of an array </li><li>array_walk — Apply a user supplied function to every member of an array </li><li>array — Create an array </li><li>arsort — Sort an array in reverse order and maintain index association</li><li>asort — Sort an array and maintain index association</li><li>compact — Create array containing variables and their values </li><li>count — Count all elements in an array, or something in an object </li><li>current — Return the current element in an array </li><li>each — Return the current key and value pair from an array and advance the array cursor </li><li>end — Set the internal pointer of an array to its last element </li><li>extract — Import variables into the current symbol table from an array </li><li>in_array — Checks if a value exists in an array </li><li>key_exists — Alias of array_key_exists </li><li>key — Fetch a key from an array </li><li>krsort — Sort an array by key in reverse order </li><li>ksort — Sort an array by key </li><li>list — Assign variables as if they were an array </li><li>natcasesort — Sort an array using a case insensitive &#8220;natural order&#8221; algorithm</li><li>natsort — Sort an array using a &#8220;natural order&#8221; algorithm </li><li>next — Advance the internal pointer of an array</li><li>pos — Alias of current </li><li>prev — Rewind the internal array pointer </li><li>range — Create an array containing a range of elements </li><li>reset — Set the internal pointer of an array to its first element</li><li>rsort — Sort an array in reverse order</li><li>shuffle — Shuffle an array </li><li>sizeof — Alias of count </li><li>sort — Sort an array </li><li>uasort — Sort an array with a user-defined comparison function and maintain index association </li><li>uksort — Sort an array by keys using a user-defined comparison function </li><li>usort — Sort an array by values using a user-defined comparison function</li></ul>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/which-array-functions-are-present-in-array/">Which Array Functions are present in Array</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/which-array-functions-are-present-in-array/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How do you use Arrays in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-do-you-use-arrays-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-do-you-use-arrays-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Wed, 04 Aug 2021 11:28:13 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[Array operators]]></category>
		<category><![CDATA[elements]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[properties]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7380</guid>

					<description><![CDATA[<p>Array Arrays are a collection of data items stored under a single name. Array provides a mechanism for declaring and [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-you-use-arrays-in-javascript/">How do you use Arrays in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Array</h2>



<p class="wp-block-paragraph">Arrays are a collection of data items stored under a single name. Array provides a mechanism for declaring and accessing several data items with only one identifier, thereby simplifying the task of data management.</p>



<p class="wp-block-paragraph">We use an array when we have to deal with multiple data items. Arrays are a special type of object. The typeof operator in JavaScript returns &#8220;object&#8221; for arrays.</p>



<h2 class="wp-block-heading">Declaration and initialization of Array</h2>



<ul class="wp-block-list"><li><strong>Using Array Literal</strong></li></ul>



<p class="wp-block-paragraph">Syntax: &#8211; var array_name = [ ];</p>



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



<h2 class="wp-block-heading">Declaration and initialization of Array</h2>



<ul class="wp-block-list"><li><strong>Using Array Literal</strong></li></ul>



<p class="wp-block-paragraph"><strong>Syntax: &#8211; var array_name = [value1, value2, value_n];</strong></p>



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



<h2 class="wp-block-heading">Declaration and initialization of Array</h2>



<ul class="wp-block-list"><li><strong>Using Array Constructor</strong></li></ul>



<p class="wp-block-paragraph"><strong>Syntax: &#8211; var array_name = new Array( );</strong></p>



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



<h2 class="wp-block-heading">Declaration and initialization of Array</h2>



<ul class="wp-block-list"><li><strong>Using Array Constructor</strong></li></ul>



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



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



<p class="wp-block-paragraph">This will create an empty array with 5 lengths. So this is not a good idea to use Array<br>Constructor if you have only a single numeric value.</p>



<p class="wp-block-paragraph">Note &#8211; By default, the array starts with index 0.</p>



<h2 class="wp-block-heading">Important Points</h2>



<ul class="wp-block-list"><li>JavaScript arrays are zero-indexed: the first element of an array is at index 0.</li><li>Using an invalid index number returns undefined.</li><li>It&#8217;s possible to quote the JavaScript array indexes as well (e.g., geek[&#8216;2&#8217;] instead of geek[2]), although it&#8217;s not necessary.</li><li>Arrays cannot use strings as element indexes but must use integers.</li><li>There is no associative array in JavaScript. geek[“fees”] = 200;</li><li>No advantage to use Array Constructor so better to use Array Literal for creating Arrays in JavaScript.</li></ul>



<h2 class="wp-block-heading">Accessing Array Elements</h2>



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



<h2 class="wp-block-heading">Accessing Array Elements</h2>



<p class="wp-block-paragraph"><strong>Access all at once</strong></p>



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



<h2 class="wp-block-heading">Modifying Array Elements</h2>



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



<h2 class="wp-block-heading">Removing Array Elements</h2>



<p class="wp-block-paragraph">Array elements can be removed using the delete operator. This operator sets the array element it is invoked on to undefined but does not change the array‟s length.</p>



<p class="wp-block-paragraph"><strong>Syantx :- delete Array_name[index];<br>Ex:- delete dev[0];</strong></p>



<h2 class="wp-block-heading">Length Property</h2>



<p class="wp-block-paragraph">The length property retrieves the index of the next available position at the end of the array. The length property is automatically updated as new elements are added to the array. For this reason, length is commonly used to iterate through all elements of an array.</p>



<script src="https://gist.github.com/vijaypk376/7f3af0f0cbf9f7287e95ecceb376ec6b.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-you-use-arrays-in-javascript/">How do you use Arrays in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-do-you-use-arrays-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How do classes work in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Wed, 04 Aug 2021 10:37:54 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Class Declaration]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7377</guid>

					<description><![CDATA[<p>Class JavaScript classes, introduced in ECMAScript 2015 or ES 6, Classes are in fact &#8220;special functions&#8221;.There are two ways to [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/">How do classes work in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Class</h2>



<p class="wp-block-paragraph">JavaScript classes, introduced in ECMAScript 2015 or ES 6, Classes are in fact &#8220;special functions&#8221;.<br><strong>There are two ways to define a class in JavaScript using class</strong> <strong>keyword:-</strong></p>



<ul class="wp-block-list"><li><strong>Class Declaration</strong></li><li><strong>Class Expression</strong></li></ul>



<h2 class="wp-block-heading">Class Declaration</h2>



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



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



<p class="wp-block-paragraph">The constructor method is a special method for creating and initializing an object created within a class. There can be only one special method with the name &#8220;constructor&#8221; in a class.</p>



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



<h2 class="wp-block-heading">Default Constructor</h2>



<p class="wp-block-paragraph">If you do not specify a constructor method a default constructor is used.</p>



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



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



<h2 class="wp-block-heading">Parameterized Constructor</h2>



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



<h2 class="wp-block-heading">Class Expression</h2>



<p class="wp-block-paragraph">Class expressions can be named or unnamed.</p>



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



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



<p class="wp-block-paragraph">Class Declarations and Class Expression are not hoisted. You first need to declare your class and then access it.</p>



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



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



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="942" height="358" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/inheritance.png" alt="" class="wp-image-7378" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/inheritance.png 942w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/inheritance-300x114.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/inheritance-768x292.png 768w" sizes="auto, (max-width: 942px) 100vw, 942px" /></figure>



<h2 class="wp-block-heading">Class Inheritance</h2>



<p class="wp-block-paragraph">The extends keyword is used in class declarations or class expressions to create a class that is a child of another class.<br>The extended keyword can be used to subclass custom classes as well as built-in objects.</p>



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



<h2 class="wp-block-heading">Class Inheritance</h2>



<ul class="wp-block-list"><li><strong>Inherit Built-in Object</strong></li></ul>



<p class="wp-block-paragraph"><strong>     – Date<br>    – String<br>    – Array</strong></p>



<p class="wp-block-paragraph">class myDate extends Date {<br>}</p>



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



<p class="wp-block-paragraph">Super ( ) is used to initialize parent class constructor. If there is a constructor present in a subclass,<br>it needs to first call super() before using &#8220;this&#8221;. A constructor can use the super keyword to call the<br>constructor of a parent class.</p>



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



<h2 class="wp-block-heading">Method Overriding</h2>



<p class="wp-block-paragraph">Same function name with different implementation.</p>



<p class="wp-block-paragraph">Parent &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;>   show ( ) {return “Super Class”; }<br>Child &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;>  show ( ) {return “Sub Class”; } show ( ) {return “Super Class”; }</p>



<h2 class="wp-block-heading">Static Method</h2>



<p class="wp-block-paragraph">The static keyword is used to define a static method for a class. Static methods are called without creating object and cannot be called through a class instance (object). Static methods are often used to create utility functions for an<br>application.</p>



<script src="https://gist.github.com/vijaypk376/c4ebef30dbdcdbed4e2addf8d02c9748.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/">How do classes work in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How does constructor work in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-does-constructor-work-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-does-constructor-work-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 10:22:26 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Parameters]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7307</guid>

					<description><![CDATA[<p>Constructor Object instance are created with constructor, which is basically a special function that prepares a new instance of an [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-constructor-work-in-javascript/">How does constructor work in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Constructor</h2>



<p class="wp-block-paragraph">Object instance are created with constructor, which is basically a special function that prepares a new instance of an object for use.</p>



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



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/constructor.jpg" alt="" class="wp-image-7310" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/constructor.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/constructor-300x225.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/constructor-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Constructor with Parameter</h2>



<script src="https://gist.github.com/vijaypk376/2c4269caa580e58a122ac08f1e86b849.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-constructor-work-in-javascript/">How does constructor work in JavaScript?</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-constructor-work-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How does this javascript factorial function work?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-does-this-javascript-factorial-function-work/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-does-this-javascript-factorial-function-work/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 10:03:51 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Factory Function]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Parameters]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7305</guid>

					<description><![CDATA[<p>Factory Function When a function returns an object, we call it a factory function. It can produce object instance without [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-this-javascript-factorial-function-work/">How does this javascript factorial function work?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Factory Function</h2>



<p class="wp-block-paragraph">When a function returns an object, we call it a factory function. It can produce object instance without <em>new</em> keywords or <em>classes</em>.</p>



<h2 class="wp-block-heading"><strong>Ex:-</strong></h2>



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



<h2 class="wp-block-heading">Factory Function with Parameter</h2>



<h2 class="wp-block-heading"><strong>Ex:-</strong></h2>



<script src="https://gist.github.com/vijaypk376/f680fed77d649686f08ca7ad05f3b50c.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-this-javascript-factorial-function-work/">How does this javascript factorial function 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-this-javascript-factorial-function-work/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Immediately Invoked Function Expression (IIFE)</title>
		<link>https://www.scmgalaxy.com/tutorials/immediately-invoked-function-expression-iife/</link>
					<comments>https://www.scmgalaxy.com/tutorials/immediately-invoked-function-expression-iife/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Mon, 02 Aug 2021 12:23:35 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[objects]]></category>
		<category><![CDATA[Variables]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7261</guid>

					<description><![CDATA[<p>IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.It is a design [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/immediately-invoked-function-expression-iife/">Immediately Invoked Function Expression (IIFE)</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.<br>It is a design pattern which is also known as Self-Executing Anonymous Function and contains two major parts. The first is the anonymous function with lexical scope enclosed within the Grouping Operator (). This prevents accessing variables within the IIFE idiom as well as polluting the global scope.<br>The second part is creating the immediately executing function expression (), through which the JavaScript engine will directly interpret the function.</p>



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



<h2 class="wp-block-heading">Immediately Invoked Function Expression (IIFE)</h2>



<ul class="wp-block-list"><li>Avoid Creating Global variable and Functions</li><li>As it doesn‟t define variable and function globally so there will be no name conflicts</li><li>Scope is limited to that particular function</li></ul>



<h2 class="wp-block-heading">Pass by Value</h2>



<ul class="wp-block-list"><li>JavaScript arguments are passed by value: The function only gets to know the values, not the argument&#8217;s locations.</li><li>If a function changes an argument&#8217;s value, it does not change the parameter&#8217;s original value.</li><li>Changes to arguments are not visible (reflected) outside the function.</li></ul>



<h2 class="wp-block-heading">Pass by reference</h2>



<ul class="wp-block-list"><li>In JavaScript, object references are values.</li><li>Because of this, objects will behave like they are passed by reference:</li><li>If a function changes an object property, it changes the original value.</li><li>Changes to object properties are visible (reflected) outside the function.</li></ul>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/immediately-invoked-function-expression-iife/">Immediately Invoked Function Expression (IIFE)</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/immediately-invoked-function-expression-iife/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What are arrow functions in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/what-are-arrow-functions-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/what-are-arrow-functions-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Mon, 02 Aug 2021 12:17:39 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[list with arrows]]></category>
		<category><![CDATA[Parameters]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7250</guid>

					<description><![CDATA[<p>An arrow function expression (previously, and now incorrectly known as fat arrow function) has a shorter syntax compared to function [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-are-arrow-functions-in-javascript/">What are arrow functions in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">An arrow function expression (previously, and now incorrectly known as fat arrow function) has a shorter syntax compared to function expressions. Arrow functions are always anonymous.</p>



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



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



<h2 class="wp-block-heading">Arrow Function</h2>



<ul class="wp-block-list"><li>Do not call before definition</li></ul>



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



<ul class="wp-block-list"><li>An arrow function cannot contain a line break between its parameters and its arrow.</li></ul>



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



<h2 class="wp-block-heading">Arrow Function With Parameter</h2>



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



<p class="wp-block-paragraph">•With one Parameter<br>    Syntax: (para) => {statement};<br>    Syntax: para => {statement};<br>•More than one Parameter<br>    Syntax: (para1, para2, paraN) => {statement};<br>•No Parameter<br>    Syntax: ( ) => {statement};</p>



<h2 class="wp-block-heading">Arrow Function with Parameter</h2>



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



<p class="wp-block-paragraph">•Default Parameter<br>    Syntax: (para1, para2 = value) => {statement};<br>•Rest Parameter<br>    Syntax: (para1, …args) => {statement};</p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-are-arrow-functions-in-javascript/">What are arrow functions in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/what-are-arrow-functions-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Define Function expression in JavaScript</title>
		<link>https://www.scmgalaxy.com/tutorials/define-function-expression-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/define-function-expression-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Sat, 31 Jul 2021 12:34:09 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Arguments]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Variables]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7237</guid>

					<description><![CDATA[<p>Function Expression When we create a function and assign it to a variable, known as a function expression. Note: &#8211; [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/define-function-expression-in-javascript/">Define Function expression in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Function Expression</h2>



<p class="wp-block-paragraph">When we create a function and assign it to a variable, known as a function expression.</p>



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



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



<ul class="wp-block-list"><li><strong>You can‟t call function expression before the function definition.</strong></li><li><strong>Function expressions in JavaScript are not hoisted, unlike function declarations.</strong></li></ul>



<h2 class="wp-block-heading">Anonymous Functions</h2>



<p class="wp-block-paragraph">Anonymous functions allow the creation of functions that have no specified name.</p>



<ul class="wp-block-list"><li><strong>Can be stored in a Variable</strong></li><li><strong>Can be Returned in a Function</strong></li><li><strong>Can be pass in a Function</strong></li></ul>



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



<h2 class="wp-block-heading">Store Anonymous Function in Variable</h2>



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



<h2 class="wp-block-heading">Passing Anonymous Function as Argument</h2>



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



<h2 class="wp-block-heading">Returning Anonymous Function</h2>



<script src="https://gist.github.com/vijaypk376/0146f165d15c123704a7e7a8d904ec71.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/define-function-expression-in-javascript/">Define Function expression in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/define-function-expression-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How do I use a default parameter in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-do-i-use-a-default-parameter-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-do-i-use-a-default-parameter-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Fri, 30 Jul 2021 13:22:43 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Arguments]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Parameters]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7213</guid>

					<description><![CDATA[<p>Default Parameter Syntax: &#8211;function function_name (para1, para2=“value”, para3) // problem undefined{Block of statement;}Syntax: &#8211;function function_name (para1, para2=“value1”, para3=“value2”){Block of statement;} [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-i-use-a-default-parameter-in-javascript/">How do I use a default parameter in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Default Parameter</h2>



<p class="wp-block-paragraph">Syntax: &#8211;<br>function function_name (para1, para2=“value”, para3) // problem undefined<br>{<br>Block of statement;<br>}<br>Syntax: &#8211;<br>function function_name (para1, para2=“value1”, para3=“value2”)<br>{<br>Block of statement;<br>}</p>



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



<p class="wp-block-paragraph">JavaScript also allows the use of arrays and null as default values.</p>



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



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



<h2 class="wp-block-heading">Rest Parameters</h2>



<p class="wp-block-paragraph">The rest parameter allows representing an indefinite number of arguments as an array.</p>



<p class="wp-block-paragraph">Syntax: &#8211;<br>function function_name (…args)<br>   {<br>      Block of statement;<br>   }</p>



<p class="wp-block-paragraph"><br>Syntax: &#8211;<br>function function_name (a, …args)<br>    {<br>      Block of statement;<br>   }</p>



<p class="wp-block-paragraph">The rest operator must be the last parameter to a function.</p>



<h2 class="wp-block-heading">Rest Vs Arguments</h2>



<p class="wp-block-paragraph">There are three main differences between the rest parameters and the arguments object:-</p>



<ul class="wp-block-list"><li>Rest parameters are only the ones that haven&#8217;t been given a separate name, while the arguments object contains all arguments passed to the function.</li><li>The arguments object is not a real array, while Rest Parameters are Array instances, meaning methods like sort, map, forEach or pop can be applied on it directly.</li><li>The arguments object has additional functionality specific to itself (like the callee property).</li></ul>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-i-use-a-default-parameter-in-javascript/">How do I use a default parameter in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-do-i-use-a-default-parameter-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Getting input from users in JavaScript</title>
		<link>https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 27 Jul 2021 13:05:27 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[External]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[Javascript]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7107</guid>

					<description><![CDATA[<p>prompt( ) – The browser provides a built-in function that can be used to get inputfrom the user, named prompt. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/">Getting input from users in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">prompt( ) – The browser provides a built-in function that can be used to get input<br>from the user, named prompt. The prompt( ) method displays a dialog box that prompts<br>the visitor for input.</p>



<p class="wp-block-paragraph">Once the prompt function obtains input from the user, it returns that input.</p>



<p class="wp-block-paragraph">Syntax: &#8211; prompt(text, defaultText)</p>



<p class="wp-block-paragraph">Ex:-  prompt(“Enter Your Name: “, “name”);<br>prompt(“Enter Your Roll No. : “);</p>



<h2 class="wp-block-heading">Good Approach</h2>



<ul class="wp-block-list"><li>Inline</li><li>External</li></ul>



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



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



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



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



<h2 class="wp-block-heading">Good Approach</h2>



<ul class="wp-block-list"><li>Inside head Tag</li><li>Inside body Tag</li></ul>



<p class="wp-block-paragraph">Inside head Tag</p>



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



<p class="wp-block-paragraph">Inside body Tag</p>



<script src="https://gist.github.com/vijaypk376/8a726555aa99262d8eab8469491b4bb6.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/">Getting input from users in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorials for PHP Functions</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorials-for-php-functions/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorials-for-php-functions/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Fri, 23 Jul 2021 13:30:47 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[create functions in PHP]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[How]]></category>
		<category><![CDATA[How many Types of Functions in PHP]]></category>
		<category><![CDATA[How to create functions in PHP]]></category>
		<category><![CDATA[PHP Function]]></category>
		<category><![CDATA[Tutorials for PHP Functions]]></category>
		<category><![CDATA[Types of Functions in PHP]]></category>
		<category><![CDATA[Use Functions in PHP]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is Functions]]></category>
		<category><![CDATA[Why]]></category>
		<category><![CDATA[Why we should Use Functions in PHP]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6994</guid>

					<description><![CDATA[<p>What is Functions? A function is a segment of code in a program that is written to do a certain [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorials-for-php-functions/">Tutorials for PHP Functions</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">What is Functions?</h2>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="http://www.devopsschool.com/blog/wp-content/uploads/2021/05/what-is-functions-in-PHP.jpg" alt="Complete Guide and Tutorials for PHP Functions with example -  DevOpsSchool.com"/></figure></div>



<p class="wp-block-paragraph">A function is a segment of code in a program that is written to do a certain task. We should compare functions to workers in a real-world workplace to have a better grasp of how they work. Assume the management delegated the duty of determining the annual budget to one of his employees. So, what will be the outcome of this procedure? The employee would ask his supervisor for data, perform estimations, calculate the budget, and report the results to his superior. Functions work in a similar fashion. They accept data as an argument, process it using a set of statements or operations, and then return the output.</p>



<h2 class="wp-block-heading">How many Types of Functions in PHP?</h2>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://www.devopsschool.com/blog/wp-content/uploads/2021/05/PHP-functions-Built-in-and-user-define-1.jpg" alt="Complete Guide and Tutorials for PHP Functions with example -  DevOpsSchool.com"/></figure></div>



<p class="wp-block-paragraph"><strong>There are Two Types of Functions :-</strong></p>



<p class="wp-block-paragraph"><strong><strong>User Defined Functions</strong></strong>:-These capabilities are used by developers and programmers when they need to execute their own logic. This functions are specified with the keyword function, and when a function call is made, a sequence of statements will be written within the function to execute it. Simply type functionname() in the address bar, and the function will be run.</p>



<p class="wp-block-paragraph"><strong>Built-in functions</strong>:- These routines offer us with already-built-in library functionality. The PHP installation kit includes several capabilities, making the language more efficient and helpful. To use the function&#8217;s attributes, all we have to do is call it when we want the desired outcome. PHP makes use of date, numeric, string, and other built-in functions.</p>



<ul class="wp-block-list"><li><strong>String Functions: </strong>These PHP features include built-in support for working with strings. Some of the string methods in PHP include strpos(), strncmp(), strrev(), and strlen() ,</li><li><strong>Date Function:</strong> The format is a human-readable UNIX date and time format, and these functions are PHP standard components.</li><li><strong>Numeric Functions: </strong>These functions have their own preset logic for numeric operations that PHP provides. As a result, it will either return a Boolean or a numeric value. Among them are is number(), number format(), round(), and other numeric procedures.</li></ul>



<h2 class="wp-block-heading">Why we should Use Functions in PHP?</h2>



<p class="wp-block-paragraph"><strong>Reusability</strong>:- This programming language has a feature that reduces the amount of lines of code that must be written many times. This would save time and effort for the developer or coder. We can put a piece of code in a feature and call it whenever and wherever it&#8217;s needed if it has to be used in many locations. This may be done by calling the functions from other programmes or from inside the same package.</p>



<p class="wp-block-paragraph"><strong>Easier Error Detection</strong>:- Because the code is written as functions rather than single blocks, any problems may be immediately and readily recognized and rectified.</p>



<p class="wp-block-paragraph"><strong>Easily Maintained</strong>:- Because functions are used throughout the program, we may quickly modify any function or line of code in the function, and the change will be reflected. As a result, it is simple to maintain everywhere.</p>



<h2 class="wp-block-heading">How to create functions in PHP?</h2>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://www.devopsschool.com/blog/wp-content/uploads/2021/05/function-in-php.jpg" alt="Complete Guide and Tutorials for PHP Functions with example -  DevOpsSchool.com"/></figure></div>



<p class="wp-block-paragraph">A function is to find a collection of statements in a programmer repeatedly. When a function in a program is invoked, it is simply implemented. There are a few things to keep in mind while creating a user-identified feature.</p>



<ul class="wp-block-list"><li>Any word ending in an opened and closed parenthesis is a feature.</li><li>The function keyword is commonly used to start a name of the function.</li><li>Type your name followed by a parenthesis to launch a command.</li><li>The initial letter in a function word cannot be a number. It might start with a letter or an emphasis.</li><li>The name of a feature is important.</li></ul>



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



<script src="https://gist.github.com/AdarshAshwani/56e4c4010d384a035234291591b8d2f8.js"></script>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorials-for-php-functions/">Tutorials for PHP Functions</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorials-for-php-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Javascript Tags</title>
		<link>https://www.scmgalaxy.com/tutorials/javascript-tags/</link>
					<comments>https://www.scmgalaxy.com/tutorials/javascript-tags/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Mon, 19 Jul 2021 13:03:27 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Variables]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6595</guid>

					<description><![CDATA[<p>&#60;script> &#8211; Opening Script Tag. src &#8211; It&#8217;s an attribute of the script. name.js &#8211; This is our script file, [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/javascript-tags/">Javascript Tags</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&amp;lt;script type=&quot;text/javascript&quot;&gt;
	document.write(&quot;Hello DevOpSchool&quot;);  
&amp;lt;/script&gt;
</pre></div>

<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&amp;lt;script src=&quot;devops.js&quot; type=&quot;text/javascript&quot;&gt;&amp;lt;/script&gt;
</pre></div>


<p class="wp-block-paragraph"><strong>&lt;script></strong> <strong>&#8211;</strong>  Opening Script Tag.</p>



<p class="wp-block-paragraph"><strong>src</strong> <strong>&#8211;</strong> It&#8217;s an attribute of the script.</p>



<p class="wp-block-paragraph"><strong>name.js &#8211;</strong> This is our script file, which we created. The code of javascript is written inside devops.js.<br>In which DevOps is the file name, .js is the extension. Javascript has an extension of .js</p>



<p class="wp-block-paragraph"><strong>Type &#8211;</strong> This is also an attribute of the script tag, it tells the browser that it is javascript. Now it is not necessary to write it, you can leave it if you want.</p>



<p class="wp-block-paragraph"><strong>Text/javascript &#8211;</strong> It defines what type these documents are.</p>



<p class="wp-block-paragraph"><strong>document.write(&#8220;Hello World&#8221;); &#8211;</strong> This is a function which is displaying the data.</p>



<p class="wp-block-paragraph"><strong>&lt;/script> &#8211;</strong> Closing Script tag.</p>



<h2 class="wp-block-heading">How to link more than one External?</h2>



<p class="wp-block-paragraph">You can link more than one JavaScript file to a single document. Just need to write different script tags for that.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&amp;lt;script src=&quot;devops1.js&quot; type=&quot;text/javascript&quot;&gt;&amp;lt;/script&gt;
&amp;lt;script src=&quot;devops2.js&quot; type=&quot;text/javascript&quot;&gt;&amp;lt;/script&gt;
&amp;lt;script src=&quot;devops2.js&quot; type=&quot;text/javascript&quot;&gt;&amp;lt;/script&gt;
&amp;lt;script src=&quot;devops3.js&quot; type=&quot;text/javascript&quot;&gt;&amp;lt;/script&gt;
</pre></div>


<h2 class="wp-block-heading">How to use inline and External together in javascript?</h2>



<p class="wp-block-paragraph">No, both cannot be written together. But both inline and external can be written separately.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&amp;lt;!DOCTYPR&gt;
&amp;lt;HTML&gt;
    &amp;lt;head&gt;&amp;lt;title&gt;&amp;lt;/title&gt;
        
            
        &amp;lt;/script&gt;
    &amp;lt;/head&gt;
    &amp;lt;body&gt;
        &amp;lt;h1&gt;I am Heading&amp;lt;/h1&gt;
        &amp;lt;p&gt;I am Paragharph&amp;lt;/p&gt;
        
        &amp;lt;script type=&quot;text/javascript&quot;&gt;
			document.write(&quot;Hello Vijay&quot;);  
		&amp;lt;/script&gt;
        &amp;lt;br&gt;
        
        &amp;lt;script src=&quot;devops.js&quot; type=&quot;text/javascript&quot;&gt;&amp;lt;/script&gt;
        
    &amp;lt;/body&gt;
&amp;lt;/html&gt;

</pre></div>


<h2 class="wp-block-heading">Write funtion</h2>



<p class="wp-block-paragraph">This function is used to write arbitrary HTML and content into the page. If we use this function after an HTML document is fully loaded, will delete all existing HTML. It is used only for testing purposes.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Ex:-    document.write(&quot;Hello world&quot;);
	    document.write(variable);
	    document.write(4+2);
	    document.write(&quot;hello world . &amp;lt;br&gt;&quot;);
	    document.write(&quot;hello world . &amp;lt;br&gt;&quot; + variable +&quot;&amp;lt;br&gt;&quot;);
</pre></div>


<h2 class="wp-block-heading">Alert function in JavaScript</h2>



<p class="wp-block-paragraph">The data that will be displayed in it will be in the dialog box. You forcefully want to see this thing, then only this work will be done. In that case, you use a window. alert</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Ex:- window.alert(&quot;Hello World&quot;);
	 window.alert(variable);
	 window.alert(4+2);
	 window.alert(&quot;hello world&quot;+ variable);
</pre></div>

<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&amp;lt;html&gt;
	&amp;lt;head&gt;&amp;lt;title&gt;Hello JS&amp;lt;/title&gt;
		&amp;lt;script&gt;
			window.alert(&quot;Hello&quot;);
		&amp;lt;/script&gt;
	&amp;lt;/head&gt;
	&amp;lt;/body&gt;
`		&amp;lt;h1&gt;I am heading&amp;lt;/h1&gt;
		&amp;lt;p&gt;I am Paraghraph&amp;lt;/p&gt;
		
		&amp;lt;script src=&quot;name.js&quot; type=&quot;text/javascript&quot;&gt;
		&amp;lt;/script&gt;
	&amp;lt;/body&gt;
&amp;lt;/html&gt;
</pre></div>


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



<p class="wp-block-paragraph">An identifier is a name having a few letters, numbers, and special characters _(underscore). It is used to identify a variable, function, symbolic constants, and so on.</p>



<p class="wp-block-paragraph">Ex:- X2<br>      PI<br>      Sigma<br>      Matadd</p>



<h2 class="wp-block-heading">Veriable in JavaScript</h2>



<p class="wp-block-paragraph">Variable can be any name, in which a combination of letters, numbers, and special characters can be written _()(underscore) and $(dollar). It is not necessary that there should be only a combination, it can only be a letter.</p>



<p class="wp-block-paragraph">Ex:- c, fact, b33, total_amount ect.</p>



<h2 class="wp-block-heading">Rules of Veriable in JavaScript</h2>



<ul class="wp-block-list"><li><strong>Variable can contain a combination of letters, digits, _()(underscore), and dollar signs($).</strong></li><li><strong>Must begin with a letter A-Z or a-z or underscore or dollar sign.</strong></li><li><strong>A variable name cannot start a number.</strong></li><li><strong>Must not contain any space characters.</strong></li><li><strong>JavaScript is case-sensitive</strong></li><li><strong>Can&#8217;t use reserved keywords.</strong></li></ul>



<h2 class="wp-block-heading">Reserved Keyword in javascript</h2>



<p class="wp-block-paragraph"><strong>Keyword or Reserved words</strong></p>



<figure class="wp-block-table"><table><tbody><tr><td>var</td><td>delete</td><td>for</td><td>let</td><td>brack</td></tr><tr><td>super</td><td>void</td><td>case</td><td>do</td><td>static</td></tr><tr><td>function</td><td>new</td><td>switch</td><td>while</td><td>interface</td></tr><tr><td>catch</td><td>else</td><td>if</td><td>package</td><td>finally</td></tr><tr><td>this</td><td>with</td><td>class</td><td>enum</td><td>default</td></tr><tr><td>implements</td><td>private</td><td>throw</td><td>tiled</td><td>typeof</td></tr><tr><td>const</td><td>export</td><td>import</td><td>protected</td><td>return</td></tr><tr><td>true</td><td>continue</td><td>extends</td><td>in</td><td></td></tr><tr><td>instanceof</td><td></td><td></td><td></td><td></td></tr><tr><td>public</td><td>try</td><td>debugger</td><td>false</td><td></td></tr></tbody></table></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/javascript-tags/">Javascript Tags</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/javascript-tags/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Advance PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/advance-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/advance-php/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Fri, 09 Jul 2021 12:19:39 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Method]]></category>
		<category><![CDATA[objects]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Variables]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6702</guid>

					<description><![CDATA[<p>What was easy in any language was made core and what became difficult was made an advance. What happens in [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/advance-php/">Advance PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">What was easy in any language was made core and what became difficult was made an advance. What happens in Core is of basic level and what happens in Advance is of upper-level.</p>



<h2 class="wp-block-heading">Object Oriented Progrmming</h2>



<p class="wp-block-paragraph">Object-Oriented Programming is a Technic that solves the problem. In this, the code breaks the object. And you see your problem on the side of the object. In which you find your problem similar to the real-world problem and it is easy to maintain, and it has to be solved.</p>



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



<p class="wp-block-paragraph">The PHP class has a group of values. To manipulate whatever value you write inside the class, you also write operations in it. The class gives you this facility, that if the user does not need to know the information. So you can also hide the information. To use the application, you can keep it hidden for security purposes. Or if it will be accessed from the outside users or from an outside viewer then your application may be damaged. That&#8217;s why you can keep your application hidden, it gives class facility. You can define type using class.</p>



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



<ul class="wp-block-list"><li>The class name can be any valid label.</li><li>It can&#8217;t be PHP reserved world.</li><li>The class name must start with a letter or an underscore. Following by any number of letters, numbers, or underscore all this will work. Lwkin should not start with number.</li></ul>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
class Classname
{
	var $variable_name;  (It is also called Data Member/Properties or Attribute.)
	var $variable_name;
	
	function Method_name()
	{
		Body of method;
	}
	function Method_name(parameter_list)     (And these methods are called methods or member functions.)
	{
		Body of Method;
	}

}
</pre></div>


<p class="wp-block-paragraph"><strong>See your problem in the real world.</strong></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
class Mobile
{
	public $model;
	function show Model (Sumber)
	{
		$this-&gt;model = $number;
		echo &quot;Model Number: $this-&gt;model&quot;;
	}
	
}
</pre></div>


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



<p class="wp-block-paragraph">The object is a variable of class data type. Whenever you create an object, for that object, whatever is proper inside the class, a copy of it is prepared and it is prepared for that object. If there are 2 objects then 2 copies of that variable or that property will be created and one copy for the first object and a second copy for the second object. Whatever object you make, its copy will be ready and one copy will be distributed. But this is not the case with the member function. The member function is the same, all the objects share with it.</p>



<p class="wp-block-paragraph"><strong>The new Operator is used to create an object.</strong></p>



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


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
class Mobile
{
	public $model;
	function show Model (Sumber)
	{
		$this-&gt;model = $number;
		echo &quot;Model Number: $this-&gt;model&quot;;
	}
	
}
$samsung = new Mobile;
$samsung-&gt;showModel(&#039;A5&#039;);

$lg = new Mobile;
$lg-&gt;showModel(&#039;M30&#039;);

</pre></div>


<p class="wp-block-paragraph">You will not need to write the class, again and again, you just have to create an object of it. And call this method with the help of that object. It will show its own model number.</p>



<p class="wp-block-paragraph"><strong>Important thing</strong></p>



<p class="wp-block-paragraph">A class is of no importance unless it has an object.</p>



<h2 class="wp-block-heading">Accessing class member using object</h2>



<p class="wp-block-paragraph">How would you make accessing a member of a class into a user object?</p>



<p class="wp-block-paragraph">-&gt; This operator is used to access the member of the class.</p>



<p class="wp-block-paragraph">object_name-&gt;variable_name;<br>$samsung-&gt;model;</p>



<p class="wp-block-paragraph">access to method<br>Object_name-&gt;method_name();<br>$samsung-&gt;showModel();</p>



<p class="wp-block-paragraph">in parameter<br>Object_name-&gt;method_name(parameter_list)<br>$samsung-&gt;showModel(&#8216;A8&#8217;);</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/advance-php/">Advance PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/advance-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Function in JavaScript</title>
		<link>https://www.scmgalaxy.com/tutorials/function-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/function-in-javascript/#comments</comments>
		
		<dc:creator><![CDATA[abhishek k]]></dc:creator>
		<pubDate>Wed, 17 Mar 2021 13:21:50 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[Function in JavaScript]]></category>
		<category><![CDATA[function types in javascript]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[how to make javascript function]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5590</guid>

					<description><![CDATA[<p>What is a Function in JavaScript A JavaScript function is a block of code designed to perform a particular task. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/function-in-javascript/">Function in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="has-medium-font-size wp-block-paragraph"><strong>What is a Function in JavaScript</strong></p>



<p class="wp-block-paragraph">A JavaScript function is a block of code designed to perform a particular task. In simple terms, Functions are used to make work easy, reduce the effort of coding multiple lines for the same task which is needed to repeat multiple times.  </p>



<ol class="wp-block-list"><li><strong>Function Declaration</strong></li><li><strong><strong>Function</strong></strong> <strong>Definition.</strong></li><li><strong><strong>Function</strong></strong> <strong>Call</strong></li></ol>



<p class="wp-block-paragraph">In JavaScript function <em>declaration </em>and <em>definition </em>are done together.  </p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/function-in-javascript/">Function in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/function-in-javascript/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
